Skip to content
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

move pytest information into pyproject.toml #333

Merged
merged 1 commit into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions api/tests/submissions/test_submission_done.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ def test_send_transcription_to_slack(
f"Please check the following transcription of u/{user.username}:"
f" asdf."
)
check_slack_message = (
f"Please check the following transcription of u/{user.username}:"
f" asdf.\n\nThis user is being watched with a chance of 100%.\n"
f"Undo this using the `unwatch {user.username}` command."
)

assert result.status_code == status.HTTP_201_CREATED
assert (
Expand Down Expand Up @@ -291,6 +296,26 @@ def test_send_transcription_to_slack(
)
== slack_client.chat_postMessage.call_args_list[-1]
)
submission.refresh_from_db()
submission.completed_by = None
submission.save()

user.overwrite_check_percentage = 1
user.save()
result = client.patch(
reverse("submission-done", args=[submission.id]),
json.dumps({"username": user.username}),
content_type="application/json",
**headers,
)
assert result.status_code == status.HTTP_201_CREATED
assert (
call(
channel=settings.SLACK_TRANSCRIPTION_CHECK_CHANNEL,
text=check_slack_message,
)
== slack_client.chat_postMessage.call_args_list[-1]
)

def test_removed_transcription_changes(self, client: Client) -> None:
"""Verify that a removed transcription is not sent to Slack."""
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@ exclude = '''
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "blossom.settings.testing"
python_files = "tests.py test_*.py *_tests.py"
addopts = "--nomigrations --cov=. --cov-report=html --cov-report=term:skip-covered -p no:warnings"
4 changes: 0 additions & 4 deletions pytest.ini

This file was deleted.