Opened 11 years ago
Closed 11 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 , 11 years ago
| Has patch: | set |
|---|---|
| Status: | new → assigned |
comment:2 by , 11 years ago
| Patch needs improvement: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
The reported issue looks valid, thanks for catching this!
Left some minor comments on Github.
comment:3 by , 11 years ago
| Patch needs improvement: | unset |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
comment:4 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
https://github.com/django/django/pull/2900