예제 #1
0
 def setUpTestData(cls):
     cls.active = ObjectiveStatusFactory(objective_status="Active")
     cls.in_progress = ObjectiveStatusFactory(objective_status="In Progress")
     cls.missed = ObjectiveStatusFactory(objective_status="Missed")
     cls.objective = ProjectObjectiveFactory(status=cls.active)
     cls.user = UserFactory(password=PASSWORD)
     cls.uri = reverse("rolodex:ajax_set_objective_status", kwargs={"pk": cls.objective.pk})
예제 #2
0
    def test_crud_finding(self):
        # Create
        status = ObjectiveStatusFactory(objective_status="In Progress")

        # Read
        self.assertEqual(status.objective_status, "In Progress")
        self.assertEqual(status.pk, status.id)
        self.assertQuerysetEqual(
            self.ObjectiveStatus.objects.all(),
            ["<ObjectiveStatus: In Progress>"],
        )

        # Update
        status.objective_status = "Done"
        status.save()
        self.assertQuerysetEqual(
            self.ObjectiveStatus.objects.all(),
            ["<ObjectiveStatus: Done>"],
        )

        # Delete
        status.delete()
        assert not self.ObjectiveStatus.objects.all().exists()
예제 #3
0
 def setUpTestData(cls):
     cls.ProjectSubtask = ProjectSubtaskFactory._meta.model
     cls.status = ObjectiveStatusFactory(objective_status="Other")