mirror of
https://github.com/django/django.git
synced 2025-11-25 21:22:14 +00:00
Fixed #26304 -- Ignored unmanaged through model in table introspection.
This commit is contained in:
parent
5155c2b458
commit
60633ef3de
4 changed files with 19 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ from django.db import connection
|
|||
from django.db.utils import DatabaseError
|
||||
from django.test import TransactionTestCase, mock, skipUnlessDBFeature
|
||||
|
||||
from .models import Article, City, Reporter
|
||||
from .models import Article, ArticleReporter, City, Reporter
|
||||
|
||||
|
||||
class IntrospectionTests(TransactionTestCase):
|
||||
|
|
@ -53,6 +53,10 @@ class IntrospectionTests(TransactionTestCase):
|
|||
self.assertNotIn('introspection_article_view',
|
||||
connection.introspection.table_names())
|
||||
|
||||
def test_unmanaged_through_model(self):
|
||||
tables = connection.introspection.django_table_names()
|
||||
self.assertNotIn(ArticleReporter._meta.db_table, tables)
|
||||
|
||||
def test_installed_models(self):
|
||||
tables = [Article._meta.db_table, Reporter._meta.db_table]
|
||||
models = connection.introspection.installed_models(tables)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue