-
Notifications
You must be signed in to change notification settings - Fork 494
Most recent with excluded fields #477
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
Changes from 7 commits
028ba91
829185d
7564885
fd1a30b
e28710a
b7df921
db8714f
aa63579
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -445,6 +445,12 @@ def test_model_with_excluded_fields(self): | |
| self.assertIn("question", all_fields_names) | ||
| self.assertNotIn("pub_date", all_fields_names) | ||
|
|
||
| most_recent = p.history.most_recent() | ||
| self.assertIn("question", all_fields_names) | ||
| self.assertNotIn("pub_date", all_fields_names) | ||
| self.assertEqual(most_recent.__class__, PollWithExcludeFields) | ||
| self.assertIn("pub_date", history._history_excluded_fields) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we also get a test case that ensures that the excluded fields are indeed excluded?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kseever the test here is already checking whether the field is present in the fields of the history model so I think it's already being covered. I have added another statement checking if the field is present in the excluded fields of the history model. It might be that I may have failed to understand your requirement so please feel free to elaborate. =)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I just noticed that the assertion I was looking for already exists on line 403 - confirming that |
||
| def test_user_model_override(self): | ||
| user1 = User.objects.create_user("user1", "[email protected]") | ||
| user2 = User.objects.create_user("user2", "[email protected]") | ||
|
|
||
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 might just change this so you don't nest the
ifstatement.Try:
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.
Have you made the changes? If not maybe I can just do them and push it for you and it stays there?
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.
Yea can you do that? Then I’ll merge