예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    def test_add_new_nationality_with_duplicate_name(self):
        new_nationality = Nationality(name=self.nationality.name)

        with self.assertRaises(ValidationError):
            new_nationality.save()
예제 #4
0
    def test_add_new_nationality_with_duplicate_name(self):
        new_nationality = Nationality(name=self.nationality.name)

        with self.assertRaises(ValidationError):
            new_nationality.save()