Ejemplo n.º 1
0
 def test_pre_save_with_delete(self):
     multi_save = Step(model=Colour, multiple=True)
     multi_save.pre_save({'colour': []},
                         Colour,
                         patient=self.patient,
                         episode=self.episode)
     self.assertEqual(Colour.objects.count(), 0)
Ejemplo n.º 2
0
 def test_pre_save_no_delete(self):
     multi_save = Step(model=Colour, multiple=True, delete_others=False)
     multi_save.pre_save({'colour': []},
                         Colour,
                         patient=self.patient,
                         episode=self.episode)
     self.assertEqual(Colour.objects.get().id, self.existing_colour.id)
Ejemplo n.º 3
0
 def test_pre_save_with_delete(self):
     multi_save = Step(model=Colour, multiple=True)
     multi_save.pre_save(
         {'colour': []}, Colour, patient=self.patient, episode=self.episode
     )
     self.assertEqual(Colour.objects.count(), 0)
Ejemplo n.º 4
0
 def test_pre_save_no_delete(self):
     multi_save = Step(model=Colour, multiple=True, delete_others=False)
     multi_save.pre_save(
         {'colour': []}, Colour, patient=self.patient, episode=self.episode
     )
     self.assertEqual(Colour.objects.get().id, self.existing_colour.id)