Opened 10 years ago

Closed 10 years ago

#22988 closed Cleanup/optimization (fixed)

Test in introspection package appears to be wrong

Reported by: jarshwah Owned by: jarshwah
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

A test in tests/introspection/tests.py appears to be wrong:

    def test_django_table_names(self):
        with connection.cursor() as cursor:
            cursor.execute('CREATE TABLE django_ixn_test_table (id INTEGER);')
            tl = connection.introspection.django_table_names()
            cursor.execute("DROP TABLE django_ixn_test_table;")
            self.assertTrue('django_ixn_testcase_table' not in tl,
                         "django_table_names() returned a non-Django table")

The assertion is checking for the non-existence of a table name that doesn't match the one just created. PR coming.

Change History (4)

comment:1 by jarshwah, 10 years ago

Has patch: set
Status: newassigned

comment:2 by Simon Charette, 10 years ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

The reported issue looks valid, thanks for catching this!

Left some minor comments on Github.

comment:3 by Simon Charette, 10 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:4 by Simon Charette <charette.s@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In b7455b52a07feb6cee482ecef9c1797d9b16221f:

Fixed #22988 -- Adjusted an introspection test assertion.

Also changed test to use assertNotIn.

Note: See TracTickets for help on using tickets.
Back to Top