mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #10647: intermediary tables between two umanaged models are no longer created.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10455 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
22
tests/modeltests/unmanaged_models/tests.py
Normal file
22
tests/modeltests/unmanaged_models/tests.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from django.test import TestCase
|
||||
from django.db import connection
|
||||
from models import Unmanaged1, Unmanaged2, Managed1
|
||||
|
||||
class ManyToManyUnmanagedTests(TestCase):
|
||||
|
||||
def test_many_to_many_between_unmanaged(self):
|
||||
"""
|
||||
The intermediary table between two unmanaged models should not be created.
|
||||
"""
|
||||
table = Unmanaged2._meta.get_field('mm').m2m_db_table()
|
||||
tables = connection.introspection.table_names()
|
||||
self.assert_(table not in tables, "Table '%s' should not exist, but it does." % table)
|
||||
|
||||
def test_many_to_many_between_unmanaged_and_managed(self):
|
||||
"""
|
||||
An intermediary table between a managed and an unmanaged model should be created.
|
||||
"""
|
||||
table = Managed1._meta.get_field('mm').m2m_db_table()
|
||||
tables = connection.introspection.table_names()
|
||||
self.assert_(table in tables, "Table '%s' does not exist." % table)
|
||||
|
||||
Reference in New Issue
Block a user