mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #33476 -- Reformatted code with Black.
This commit is contained in:
parent
f68fa8b45d
commit
9c19aff7c7
1992 changed files with 139577 additions and 96284 deletions
|
@ -5,7 +5,6 @@ from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2
|
|||
|
||||
|
||||
class SimpleTests(TestCase):
|
||||
|
||||
def test_simple(self):
|
||||
"""
|
||||
The main test here is that the all the models can be created without
|
||||
|
@ -37,23 +36,24 @@ class SimpleTests(TestCase):
|
|||
self.assertEqual(len(resp), 1)
|
||||
|
||||
self.assertIsInstance(resp[0], C02)
|
||||
self.assertEqual(resp[0].f_a, 'barney')
|
||||
self.assertEqual(resp[0].f_a, "barney")
|
||||
|
||||
|
||||
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()
|
||||
table = Unmanaged2._meta.get_field("mm").m2m_db_table()
|
||||
tables = connection.introspection.table_names()
|
||||
self.assertNotIn(table, tables, "Table '%s' should not exist, but it does." % table)
|
||||
self.assertNotIn(
|
||||
table, 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()
|
||||
table = Managed1._meta.get_field("mm").m2m_db_table()
|
||||
tables = connection.introspection.table_names()
|
||||
self.assertIn(table, tables, "Table '%s' does not exist." % table)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue