-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test models should exist in corresponding test case, not in a global models.py
.
#1777
Comments
Sorry, I didn't fully understand this. Specifically which test files are we talking about here? |
By "test application models file" I meant in the models.py that is contained in the test project/app (tests/models.py) |
Happy to approach it incrementally. |
This one will be easier to deal with |
You mean the |
This doesn't particularly need to block a 2.4 release - removing the milestone. |
models.py
.
models.py
.models.py
.
I was a bit curious and took a peek at For example BlogPost model is only referenced in UniqueValidator section in |
Note it's almost certainly just because there's a bunch of stuff in there that's no longer used. (Kinda the motivation of this issue to prevent this sort of thing) Delete those models at will! :) |
Opened #2161 to start cleaning them up. |
V nice! |
The relational models in there probably need to stay - tried moving them into seperate test case modules, but the reverse relationships raised conflicts due to duplicated names or something. |
Was #2161 enough to close this issue or do we still have some related work ? |
Mostly resolved. Remaining stuff isn't worth keeping on our todo list anymore. |
Due to a side effect with Django 1.7, some test models have been moved within the models file of the test application.
Following what has been said in #1398 this may not be what we want.
I'm fine with models being defined in the test application models file. This is open to discussion.
The text was updated successfully, but these errors were encountered: