def test_can_save_same_record_to_diffrent_pack(self): pack1 = Pack.objects.create() pack2 = Pack.objects.create() Record.objects.create(pack=pack1, text='dup') record = Record(pack=pack2, text='dup') record.full_clean() # should not raise
def test_cannot_save_empty_records(self): pack = Pack.objects.create() record = Record(pack=pack, text='') with self.assertRaises(ValidationError): record.save() record.full_clean()