Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only import gis test apps for geo-enabled DBs
- Loading branch information
Showing
1 changed file
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57f190e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claudep Can you clarify the reason for this commit (since it's not linked to a ticket or any other rationale)? With the test discovery patch we made an intentional choice to treat the GIS tests less magically and include them along with everything else, using the normal test-skipping decorators in the test files themselves to skip specific tests that cannot be run with a non-spatial backend. This also makes test counts more consistent, since the not-run tests are reported as skipped rather than omitted entirely.
If this choice was causing a specific problem I'm not necessarily opposed to reversing it, but I'd like to know what the problem was.
57f190e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, never mind - I see the previous commit now. I guess we hadn't removed the magic for the test apps within django.contrib.gis.tests, and you're doing that now. I am still curious though why this follow-up commit was necessary.
57f190e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I broke the test suite with the previous commit. The problem is that loading gis test apps with a non gis-enabled backend chokes when trying to create gis database fields. See http://ci.djangoproject.com/job/Django/2866/database=sqlite3,python=python2.7/console
57f190e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I saw that in the IRC backlog just now. I suppose the other option would be to make the model definitions in
models.py
conditional onHAS_SPATIAL_DB
.57f190e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would also be an option. Just tell me if you'd prefer that option.
57f190e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, I don't think it's worth changing. It's effectively the same thing; either we add them to
INSTALLED_APPS
conditionally as you do here, or we always add them toINSTALLED_APPS
and make their model definitions conditional. Not seeing a significant advantage to either approach.