mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Switched TestCase to SimpleTestCase where possible in Django's tests.
This commit is contained in:
@@ -4,13 +4,13 @@ from django.apps.registry import Apps
|
||||
from django.db import models
|
||||
from django.db.models import signals
|
||||
from django.dispatch import receiver
|
||||
from django.test import TestCase
|
||||
from django.test import SimpleTestCase, TestCase
|
||||
from django.test.utils import isolate_apps
|
||||
|
||||
from .models import Author, Book, Car, Person
|
||||
|
||||
|
||||
class BaseSignalTest(TestCase):
|
||||
class BaseSignalSetup:
|
||||
def setUp(self):
|
||||
# Save up the number of connected signals so that we can check at the
|
||||
# end that all the signals we register get properly unregistered (#9989)
|
||||
@@ -32,7 +32,7 @@ class BaseSignalTest(TestCase):
|
||||
self.assertEqual(self.pre_signals, post_signals)
|
||||
|
||||
|
||||
class SignalTests(BaseSignalTest):
|
||||
class SignalTests(BaseSignalSetup, TestCase):
|
||||
def test_model_pre_init_and_post_init(self):
|
||||
data = []
|
||||
|
||||
@@ -281,7 +281,7 @@ class SignalTests(BaseSignalTest):
|
||||
ref.assert_not_called()
|
||||
|
||||
|
||||
class LazyModelRefTest(BaseSignalTest):
|
||||
class LazyModelRefTests(BaseSignalSetup, SimpleTestCase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.received = []
|
||||
|
||||
Reference in New Issue
Block a user