summaryrefslogtreecommitdiff
path: root/tests/admin_checks
diff options
context:
space:
mode:
authorDiego Guimarães <diegobr.sistemas@gmail.com>2014-09-08 19:38:07 +0200
committerTim Graham <timograham@gmail.com>2014-11-27 19:42:30 -0500
commitf39b0421b406b411c3bcb58e8aa415d885fea505 (patch)
treea98fcdb8b484682feb7f02c3ce52ac06686aefaf /tests/admin_checks
parentabf87333a163717308927ad1f230efe45d622c69 (diff)
downloaddjango-f39b0421b406b411c3bcb58e8aa415d885fea505.tar.gz
Fixed #23338 -- Added warning when unique=True on ForeigKey
Thanks Jonathan Lindén for the initial patch, and Tim Graham and Gabe Jackson for the suggestions.
Diffstat (limited to 'tests/admin_checks')
-rw-r--r--tests/admin_checks/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/admin_checks/tests.py b/tests/admin_checks/tests.py
index 799fc2899a..1e9b6f4646 100644
--- a/tests/admin_checks/tests.py
+++ b/tests/admin_checks/tests.py
@@ -8,6 +8,7 @@ from django.contrib.contenttypes.admin import GenericStackedInline
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
+from django.test.utils import override_settings
from .models import Song, Book, Album, TwoAlbumFKAndAnE, City, State, Influence
@@ -34,6 +35,10 @@ class ValidFormFieldsets(admin.ModelAdmin):
)
+@override_settings(
+ SILENCED_SYSTEM_CHECKS=['fields.W342'], # ForeignKey(unique=True)
+ INSTALLED_APPS=['django.contrib.auth', 'django.contrib.contenttypes', 'admin_checks']
+)
class SystemChecksTestCase(TestCase):
def test_checks_are_performed(self):