def test_duplicates_overwrite_eachother(self): HouseCode.objects.create(code="FA-32") house_code = HouseCode(code="FA-32") house_code.save() self.assertEqual(len(HouseCode.objects.all()), 1)
def test_overwrite_doesn_not_error_when_no_existing_house_code(self): hc1 = HouseCode(code='FA-32') hc1.save(overwrite=True)
def test_save_can_overwrite(self): hc1 = HouseCode.objects.create(code='FA-32') hc2 = HouseCode(code='FA-32') hc2.save(overwrite=True)