From 39a16dd2e003f9ca82a6d061a022ced6904bd243 Mon Sep 17 00:00:00 2001 From: José Tomás Tocino Date: Mon, 2 Nov 2015 00:53:43 +0100 Subject: Fixed #25658 -- Allowed inspectdb to inspect a specific set of tables. --- tests/inspectdb/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py index 6fd1778b55..37ba8db89c 100644 --- a/tests/inspectdb/tests.py +++ b/tests/inspectdb/tests.py @@ -28,6 +28,17 @@ class InspectDBTestCase(TestCase): # inspected self.assertNotIn("class DjangoContentType(models.Model):", out.getvalue(), msg=error_message) + def test_table_option(self): + """ + inspectdb can inspect a subset of tables by passing the table names as + arguments. + """ + out = StringIO() + call_command('inspectdb', 'inspectdb_people', stdout=out) + output = out.getvalue() + self.assertIn('class InspectdbPeople(models.Model):', output) + self.assertNotIn("InspectdbPeopledata", output) + def make_field_type_asserter(self): """Call inspectdb and return a function to validate a field type in its output""" out = StringIO() -- cgit v1.3