mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #23395 -- Limited line lengths to 119 characters.
This commit is contained in:
committed by
Tim Graham
parent
84b0a8d2aa
commit
b1e33ceced
@@ -138,9 +138,13 @@ class IntrospectionTests(TransactionTestCase):
|
||||
def test_get_relations_alt_format(self):
|
||||
"""With SQLite, foreign keys can be added with different syntaxes."""
|
||||
with connection.cursor() as cursor:
|
||||
cursor.fetchone = mock.Mock(return_value=[
|
||||
"CREATE TABLE track(id, art_id INTEGER, FOREIGN KEY(art_id) REFERENCES %s(id));" % Article._meta.db_table
|
||||
])
|
||||
cursor.fetchone = mock.Mock(
|
||||
return_value=[
|
||||
"CREATE TABLE track(id, art_id INTEGER, FOREIGN KEY(art_id) REFERENCES {}(id));".format(
|
||||
Article._meta.db_table
|
||||
)
|
||||
]
|
||||
)
|
||||
relations = connection.introspection.get_relations(cursor, 'mocked_table')
|
||||
self.assertEqual(relations, {'art_id': ('id', Article._meta.db_table)})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user