mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
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.
This commit is contained in:
committed by
Tim Graham
parent
abf87333a1
commit
f39b0421b4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user