1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Refs #29004 -- Optimized InspectDBTransactionalTests.test_include_views() by limiting introspected tables.

This commit is contained in:
Mariusz Felisiak 2018-03-11 12:52:55 +01:00 committed by Tim Graham
parent 25b97ee170
commit c3a1337dfa

View File

@ -284,11 +284,11 @@ class InspectDBTransactionalTests(TransactionTestCase):
view_model = 'class InspectdbPeopleView(models.Model):' view_model = 'class InspectdbPeopleView(models.Model):'
view_managed = 'managed = False # Created from a view.' view_managed = 'managed = False # Created from a view.'
try: try:
call_command('inspectdb', stdout=out) call_command('inspectdb', table_name_filter=inspectdb_tables_only, stdout=out)
no_views_output = out.getvalue() no_views_output = out.getvalue()
self.assertNotIn(view_model, no_views_output) self.assertNotIn(view_model, no_views_output)
self.assertNotIn(view_managed, no_views_output) self.assertNotIn(view_managed, no_views_output)
call_command('inspectdb', include_views=True, stdout=out) call_command('inspectdb', table_name_filter=inspectdb_tables_only, include_views=True, stdout=out)
with_views_output = out.getvalue() with_views_output = out.getvalue()
self.assertIn(view_model, with_views_output) self.assertIn(view_model, with_views_output)
self.assertIn(view_managed, with_views_output) self.assertIn(view_managed, with_views_output)