Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#16681 closed Cleanup/optimization (fixed)

modeltests.invalid_models tests are a weird special case

Reported by: anthonyb Owned by: nobody
Component: Testing framework Version: 1.3
Severity: Normal Keywords: invalid models invalid_models
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: no UI/UX: no

Description

The test application in modeltests.invalid_models is broken, so there's a bunch of special case handling in the test runner to avoid importing/running it, as well as a top level unittest.TestCase class. It also means that you can't specifically run the invalid_models test, and have to run them as part of the whole suite.

Attached is a patch which pushes the broken app down into a subdirectory, and removes ~60 special case lines from runtests.py.

Attachments (1)

django-invalid-model-tests.diff (56.2 KB) - added by anthonyb 4 years ago.
Patch to fix invalid_models and streamline runtests.py

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by anthonyb

Patch to fix invalid_models and streamline runtests.py

comment:1 Changed 4 years ago by russellm

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

In [16661]:

Fixed #16681 -- Refactored the invalid_models unit test so that it can be invoked manually. Thanks to Anthony Briggs for the report and patch.

comment:2 Changed 4 years ago by russellm

In [16674]:

[1.3.X] Fixed #16681 -- Refactored the invalid_models unit test so that it can be invoked manually. Thanks to Anthony Briggs for the report and patch.

Backport of r16661 from trunk.

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