diff options
author | Alasdair Nicol <alasdair@thenicols.net> | 2015-04-27 15:59:16 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-04-28 09:31:04 -0400 |
commit | eaeea6f94701547ce1b50dbcf5cf71460e9e4c91 (patch) | |
tree | 079b87aab13fc4db25f88ad2c98e68512c7bc39a /tests/validation | |
parent | 3b133ffb8bdf1e0e4c3f2c3af8a62376da643350 (diff) | |
download | django-eaeea6f94701547ce1b50dbcf5cf71460e9e4c91.tar.gz |
Fixed #24714 -- Used more specific assertions than assertEqual in tests.
Diffstat (limited to 'tests/validation')
-rw-r--r-- | tests/validation/test_validators.py | 2 | ||||
-rw-r--r-- | tests/validation/tests.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/validation/test_validators.py b/tests/validation/test_validators.py index c3875d4601..d06605eeca 100644 --- a/tests/validation/test_validators.py +++ b/tests/validation/test_validators.py @@ -7,7 +7,7 @@ from .models import ModelToValidate class TestModelsWithValidators(ValidationTestCase): def test_custom_validator_passes_for_correct_value(self): mtv = ModelToValidate(number=10, name='Some Name', f_with_custom_validator=42) - self.assertEqual(None, mtv.full_clean()) + self.assertIsNone(mtv.full_clean()) def test_custom_validator_raises_error_for_incorrect_value(self): mtv = ModelToValidate(number=10, name='Some Name', f_with_custom_validator=12) diff --git a/tests/validation/tests.py b/tests/validation/tests.py index defd66edec..693d6b6c23 100644 --- a/tests/validation/tests.py +++ b/tests/validation/tests.py @@ -19,7 +19,7 @@ class BaseModelValidationTests(ValidationTestCase): def test_with_correct_value_model_validates(self): mtv = ModelToValidate(number=10, name='Some Name') - self.assertEqual(None, mtv.full_clean()) + self.assertIsNone(mtv.full_clean()) def test_custom_validate_method(self): mtv = ModelToValidate(number=11) @@ -37,7 +37,7 @@ class BaseModelValidationTests(ValidationTestCase): def test_correct_FK_value_validates(self): parent = ModelToValidate.objects.create(number=10, name='Some Name') mtv = ModelToValidate(number=10, name='Some Name', parent_id=parent.pk) - self.assertEqual(None, mtv.full_clean()) + self.assertIsNone(mtv.full_clean()) def test_limited_FK_raises_error(self): # The limit_choices_to on the parent field says that a parent object's @@ -52,7 +52,7 @@ class BaseModelValidationTests(ValidationTestCase): def test_correct_email_value_passes(self): mtv = ModelToValidate(number=10, name='Some Name', email='valid@email.com') - self.assertEqual(None, mtv.full_clean()) + self.assertIsNone(mtv.full_clean()) def test_wrong_url_value_raises_error(self): mtv = ModelToValidate(number=10, name='Some Name', url='not a url') |