diff options
author | Simon Charette <charette.s@gmail.com> | 2015-11-17 00:39:28 -0500 |
---|---|---|
committer | Simon Charette <charette.s@gmail.com> | 2016-01-06 20:00:07 -0500 |
commit | a08fda2111d811aa53f11218fa03f3300dfff4cb (patch) | |
tree | 0263cf99adf17c5123b3a53c686f637d5b40eda4 /tests/str | |
parent | 3096f4b0829a005c67a14cc4bb6d345aa32672a1 (diff) | |
download | django-a08fda2111d811aa53f11218fa03f3300dfff4cb.tar.gz |
Fixed #25746 -- Isolated inlined test models registration.
Thanks to Tim for the review.
Diffstat (limited to 'tests/str')
-rw-r--r-- | tests/str/tests.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/str/tests.py b/tests/str/tests.py index 6467875a5c..08fd554e5e 100644 --- a/tests/str/tests.py +++ b/tests/str/tests.py @@ -4,9 +4,9 @@ from __future__ import unicode_literals import datetime from unittest import skipIf -from django.apps.registry import Apps from django.db import models from django.test import TestCase +from django.test.utils import isolate_apps from django.utils import six from .models import Article, InternationalArticle @@ -36,16 +36,14 @@ class SimpleTests(TestCase): # python_2_unicode_compatible decorator is used. self.assertEqual(str(a), b'Girl wins \xe2\x82\xac12.500 in lottery') + @isolate_apps('str') def test_defaults(self): """ The default implementation of __str__ and __repr__ should return instances of str. """ - test_apps = Apps(['str']) - class Default(models.Model): - class Meta: - apps = test_apps + pass obj = Default() # Explicit call to __str__/__repr__ to make sure str()/repr() don't |