-
Notifications
You must be signed in to change notification settings - Fork 839
Fix TypeError at /o/token/ #1597
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -60,6 +60,8 @@ def always_invalid_token(): | |||||
| class TestOAuth2Validator(TransactionTestCase): | ||||||
| def setUp(self): | ||||||
| self.user = UserModel.objects.create_user("user", "test@example.com", "123456") | ||||||
| self.user.last_login = None | ||||||
| self.user.save() | ||||||
|
Comment on lines
+63
to
+64
|
||||||
| self.user.last_login = None | |
| self.user.save() |
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.
int(timezone.now().timestamp())can differ from Django’sdateformat.format(..., 'U')behavior (notably whenUSE_TZ=False, where.timestamp()on naive datetimes is interpreted in local time). For consistency with the existing codepath and Django’s formatting semantics, compute the fallback using the same mechanism as the non-null branch (i.e., formattimezone.now()with'U').