Ejemplo n.º 1
0
    def test_additional_data(self):
        action_point = ActionPointFactory(status='pre_completed')
        initial_data = create_dict_with_relations(action_point)

        action_point.assigned_to = UserFactory()
        action_point.complete()
        action_point.save()

        author = UserFactory()
        create_snapshot(action_point, initial_data, author)

        self.assertEqual(action_point.history.count(), 1)

        snapshot = action_point.history.first()
        self.assertIn('key_events', snapshot.data)
        self.assertIn(ActionPoint.KEY_EVENTS.status_update, snapshot.data['key_events'])
        self.assertIn(ActionPoint.KEY_EVENTS.reassign, snapshot.data['key_events'])
Ejemplo n.º 2
0
    def test_additional_data(self):
        action_point = ActionPointFactory(status='pre_completed')
        initial_data = create_dict_with_relations(action_point)

        action_point.assigned_to = UserFactory()
        action_point.complete()
        action_point.save()

        author = UserFactory()
        create_snapshot(action_point, initial_data, author)

        self.assertEqual(action_point.history.count(), 1)

        snapshot = action_point.history.first()
        self.assertIn('key_events', snapshot.data)
        self.assertIn(ActionPoint.KEY_EVENTS.status_update,
                      snapshot.data['key_events'])
        self.assertIn(ActionPoint.KEY_EVENTS.reassign,
                      snapshot.data['key_events'])
Ejemplo n.º 3
0
 def test_completion_date(self):
     action_point = ActionPointFactory(status='pre_completed')
     self.assertIsNone(action_point.date_of_completion)
     action_point.complete()
     action_point.save()
     self.assertIsNotNone(action_point.date_of_completion)
Ejemplo n.º 4
0
 def test_completion_date(self):
     action_point = ActionPointFactory(status='pre_completed')
     self.assertIsNone(action_point.date_of_completion)
     action_point.complete()
     action_point.save()
     self.assertIsNotNone(action_point.date_of_completion)