1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Switched TestCase to SimpleTestCase where possible in Django's tests.

This commit is contained in:
Tim Graham
2018-11-26 14:05:02 -05:00
parent f091ea3515
commit 193c109327
37 changed files with 130 additions and 134 deletions

View File

@@ -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")