mirror of
https://github.com/django/django.git
synced 2025-10-28 16:16:12 +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
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user