diff --git a/stagestatus/apps/machines/tests.py b/stagestatus/apps/machines/tests.py index 2ab0cdc..61b422a 100644 --- a/stagestatus/apps/machines/tests.py +++ b/stagestatus/apps/machines/tests.py @@ -6,17 +6,23 @@ from model_mommy import mommy # Models from django.contrib.auth.models import User -from .models import MachineStatus +import models class MachineTest(TestCase): + def setUp(self): self.user = mommy.make(User) - self.machinestatus = mommy.make( - MachineStatus, - user=self.user, + self.machine_status = mommy.make( + models.MachineStatus, make_m2m=True) - self.machine = self.machinestatus.machine + self.machine = self.machine_status.machine + self.machine_note = mommy.make( + models.MachineNote, + user=self.user, + machine=self.machine + ) - def test_init(self): - pass + def test_mommy(self): + self.assertEqual(self.machine_status.machine, self.machine) + self.assertEqual(self.machine_note.machine, self.machine)