mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Switched TestCase to SimpleTestCase where possible in Django's tests.
This commit is contained in:
parent
f091ea3515
commit
193c109327
37 changed files with 130 additions and 134 deletions
|
|
@ -3,14 +3,14 @@ from django.core.exceptions import NON_FIELD_ERRORS
|
|||
from django.test import TestCase
|
||||
from django.utils.functional import lazy
|
||||
|
||||
from . import ValidationTestCase
|
||||
from . import ValidationAssertions
|
||||
from .models import (
|
||||
Article, Author, GenericIPAddressTestModel, GenericIPAddrUnpackUniqueTest,
|
||||
ModelToValidate,
|
||||
)
|
||||
|
||||
|
||||
class BaseModelValidationTests(ValidationTestCase):
|
||||
class BaseModelValidationTests(ValidationAssertions, TestCase):
|
||||
|
||||
def test_missing_required_field_raises_error(self):
|
||||
mtv = ModelToValidate(f_with_custom_validator=42)
|
||||
|
|
@ -126,7 +126,7 @@ class ModelFormsTests(TestCase):
|
|||
self.assertEqual(list(form.errors), ['pub_date'])
|
||||
|
||||
|
||||
class GenericIPAddressFieldTests(ValidationTestCase):
|
||||
class GenericIPAddressFieldTests(ValidationAssertions, TestCase):
|
||||
|
||||
def test_correct_generic_ip_passes(self):
|
||||
giptm = GenericIPAddressTestModel(generic_ip="1.2.3.4")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue