Code

Opened 2 years ago

Closed 2 years ago

Last modified 6 months ago

#18412 closed Cleanup/optimization (fixed)

Make `inspectdb` regression tests introspect a manageable database

Reported by: ramiro Owned by: nobody
Component: Testing framework Version: master
Severity: Normal Keywords: inspectdb
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by ramiro)

Currently, the tests in our test suite direct the inspectdb management command calls to examine the 'default' database that will contain the tables corresponding to all the models of the suite being run (they can be hundreds in the case of the full suite).

This makes creating new test cases for the introspection functionality harder that it should because one needs to peruse a gigantic models.py file.

Maybe we can add a third DB to the DATABASES setting used for our tests and direct/restrict the models in regressiontests/inspectdb/models.py to such DB by using a router?.

Attachments (0)

Change History (6)

comment:1 Changed 2 years ago by ramiro

  • Summary changed from Make syncdb regression tests to introspect a manageable database to Make syncdb regression tests introspect a manageable database

comment:2 Changed 2 years ago by ramiro

  • Description modified (diff)
  • Summary changed from Make syncdb regression tests introspect a manageable database to Make `inspectdb` regression tests introspect a manageable database

(s/syncdb/inspectdb/g in ticket summary and description).

comment:3 Changed 2 years ago by aaugustin

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 2 years ago by ramiro

  • Resolution set to fixed
  • Status changed from new to closed

comment:5 Changed 6 months ago by jacobwegner@…

I think it would be useful to refactor the table_name_filter as part of the management command...perhaps something like

manage.py inspect db --table_name_starts_with=Audit

or

manage.py inspect db --table_name_starts_with=Audit --table_name_exact=AuditLog

Is this worth considering? If so, I will work on a patch.

If the filter really is only meant for tests and it doesn't seem useful to anyone else to expose it as part of the management command "proper", I'll drop it.

comment:6 Changed 6 months ago by timo

Jacob, I suggest creating a new ticket rather than commenting on a closed one.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.