-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: fix override model save method #42
base: main
Are you sure you want to change the base?
fix: fix override model save method #42
Conversation
@@ -125,7 +126,6 @@ def my_serializer_1(obj): | |||
self.assertEqual("", published[1].body["last_name"]) | |||
self.assertEqual("", published[1].body["first_name"]) | |||
self.assertIsNone(published[1].body["last_login"]) | |||
self.assertAlmostEqual(date_joined.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3], published[1].body["date_joined"]) |
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.
This line was removed because it caused inconsistency in the tests, sometimes passing, sometimes not.
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.
what do you think about use a freezegun ever than remove the line ?
09a77ad
to
afdf5ee
Compare
afdf5ee
to
2272894
Compare
@@ -1,3 +1,4 @@ | |||
# pylint: disable=protected-access |
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.
question: What is the motivation to include this bypass? Not is possible to remove that?
@@ -125,7 +126,6 @@ def my_serializer_1(obj): | |||
self.assertEqual("", published[1].body["last_name"]) | |||
self.assertEqual("", published[1].body["first_name"]) | |||
self.assertIsNone(published[1].body["last_login"]) | |||
self.assertAlmostEqual(date_joined.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3], published[1].body["date_joined"]) |
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.
what do you think about use a freezegun ever than remove the line ?
This PR aims to fix a, perhaps critical, issue, which was the overlap of the
save
method in the model. Without the correction, it is not possible to perform actions as shown in the example because thesave
method will never be executed.