コード例 #1
0
 def test_add_milestone_valid_target_date(self):
     p = ProjectFactory()
     p.add_milestone('name', '2020-04-04', 'desc')
     p.add_milestone('name', '2020-04-4', 'desc')
     p.add_milestone('name', '2020-4-04', 'desc')
     self.assertEqual(Milestone.objects.filter(project=p).count(), 3)
コード例 #2
0
 def test_add_milestone_invalid_target_date(self):
     p = ProjectFactory()
     with self.assertRaises(forms.ValidationError):
         p.add_milestone('name', 'not a date', 'desc')