summaryrefslogtreecommitdiff
path: root/tests/model_validation
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/model_validation
parentabf87333a163717308927ad1f230efe45d622c69 (diff)
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/model_validation')
-rw-r--r--tests/model_validation/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/model_validation/tests.py b/tests/model_validation/tests.py
index a9fb30cbcd..50ccfd2de6 100644
--- a/tests/model_validation/tests.py
+++ b/tests/model_validation/tests.py
@@ -3,6 +3,7 @@ from django.core.checks import run_checks, Error
from django.db.models.signals import post_init
from django.test import TestCase
from django.utils import six
+from django.test.utils import override_settings
class OnPostInit(object):
@@ -14,6 +15,10 @@ def on_post_init(**kwargs):
pass
+@override_settings(
+ INSTALLED_APPS=['django.contrib.auth', 'django.contrib.contenttypes'],
+ SILENCED_SYSTEM_CHECKS=['fields.W342'], # ForeignKey(unique=True)
+)
class ModelValidationTest(TestCase):
def test_models_validate(self):
# All our models should validate properly