def test_create_new_nationality(self): new_nationality = Nationality(name='American') new_nationality.save() self.assertTrue(new_nationality.pk) self.assertTrue(new_nationality.is_active) self.assertIsInstance(new_nationality, Nationality)
def test_add_new_nationality_with_duplicate_name(self): new_nationality = Nationality(name=self.nationality.name) with self.assertRaises(ValidationError): new_nationality.save()