def test_cannot_save_empty_entrees(self): ars = Arsenal.objects.create() entree = Entree(arsenal=ars, name='') with self.assertRaises(ValidationError): entree.save() entree.full_clean()
def test_entree_is_related_to_list(self): ars = Arsenal.objects.create() entree = Entree() entree.arsenal = ars entree.save() self.assertIn(entree, ars.entree_set.all())