mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #25746 -- Isolated inlined test models registration.
Thanks to Tim for the review.
This commit is contained in:
@@ -4,6 +4,7 @@ from django.db import models
|
||||
from django.db.models import signals
|
||||
from django.dispatch import receiver
|
||||
from django.test import TestCase
|
||||
from django.test.utils import isolate_apps
|
||||
from django.utils import six
|
||||
|
||||
from .models import Author, Book, Car, Person
|
||||
@@ -285,6 +286,7 @@ class LazyModelRefTest(BaseSignalTest):
|
||||
finally:
|
||||
signals.post_init.disconnect(self.receiver, sender=Book)
|
||||
|
||||
@isolate_apps('signals')
|
||||
def test_not_loaded_model(self):
|
||||
signals.post_init.connect(
|
||||
self.receiver, sender='signals.Created', weak=False
|
||||
|
||||
Reference in New Issue
Block a user