diff --git a/stagestatus/__init__.py b/stagestatus/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/stagestatus/apps/machines/tests.py b/stagestatus/apps/machines/tests.py deleted file mode 100644 index 61b422a..0000000 --- a/stagestatus/apps/machines/tests.py +++ /dev/null @@ -1,28 +0,0 @@ -from __future__ import print_function - -from django.test import TestCase - -from model_mommy import mommy - -# Models -from django.contrib.auth.models import User -import models - - -class MachineTest(TestCase): - - def setUp(self): - self.user = mommy.make(User) - self.machine_status = mommy.make( - models.MachineStatus, - make_m2m=True) - self.machine = self.machine_status.machine - self.machine_note = mommy.make( - models.MachineNote, - user=self.user, - machine=self.machine - ) - - def test_mommy(self): - self.assertEqual(self.machine_status.machine, self.machine) - self.assertEqual(self.machine_note.machine, self.machine) diff --git a/stagestatus/apps/machines/tests/__init__.py b/stagestatus/apps/machines/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/stagestatus/apps/machines/tests/test_models.py b/stagestatus/apps/machines/tests/test_models.py new file mode 100644 index 0000000..6333547 --- /dev/null +++ b/stagestatus/apps/machines/tests/test_models.py @@ -0,0 +1,30 @@ +from __future__ import print_function + +from django.test import TestCase + +from model_mommy import mommy + +# Models +from django.contrib.auth.models import User +from machines.models import Machine, MachineStatus, MachineNote + + +class ModelsTest(TestCase): + + def setUp(self): + self.user = mommy.make(User) + self.machine = mommy.make(Machine) + self.machine_status = mommy.make(MachineStatus, + machine=self.machine + ) + self.machine_note = mommy.make(MachineNote, + user=self.user, + machine=self.machine + ) + + def test_mommy(self): + """ General assertions to test models """ + self.assertEqual(self.machine_status.machine, self.machine) + self.assertEqual(self.machine_note.machine, self.machine) + self.assertEqual(self.machine_status.machine, + self.machine_note.machine)