-
-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Version 0.0.11 prerelease * Removes allowed failure
- Loading branch information
Showing
9 changed files
with
98 additions
and
27 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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from server.logics.exceptions import AuthenticationException | ||
from server.models import ApplicationUser, TelegramSession | ||
|
||
|
||
def current_session( | ||
telegram_id: int, | ||
for_update: bool = True, | ||
) -> TelegramSession: | ||
""" | ||
Was triggering `AttributeError`. | ||
See: https://github.com/wemake-services/wemake-python-styleguide/issues/112 | ||
""" | ||
try: | ||
query = TelegramSession.objects.all() | ||
if for_update: # Try to comment this `if` to fix everything | ||
query = query.select_for_update() | ||
|
||
return query.get( | ||
uid=telegram_id, | ||
is_verified=True, | ||
) | ||
|
||
except TelegramSession.DoesNotExist: | ||
raise AuthenticationException('Session is missing') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import subprocess | ||
|
||
|
||
def test_regression_122(absolute_path): | ||
""" | ||
For some reason there was an issue with `compat.py`. | ||
When installing this package via `pip` there was an issue with | ||
`ast` parsing. But, after moving `compat.py` to tests only, | ||
the issue seems to be gone. | ||
Conclusion: do not touch something that is working! | ||
See: https://github.com/wemake-services/wemake-python-styleguide/issues/112 | ||
""" | ||
fixture = absolute_path('fixtures', 'regression', 'issue112.py') | ||
process = subprocess.Popen( | ||
['flake8', '--select', 'Z', fixture], | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
) | ||
stdout, _ = process.communicate() | ||
|
||
assert stdout.count(b'Z') == 0 |
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
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
This file was deleted.
Oops, something went wrong.