mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-11-21 22:18:04 +01:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
d029177b54
commit
7351af53db
4 changed files with 22 additions and 22 deletions
|
@ -8,7 +8,7 @@ from common.models import User
|
||||||
from party.models import Party
|
from party.models import Party
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_can_access_own_character(client):
|
def test_can_access_own_character(client):
|
||||||
player = User.objects.create_user("username", password="password")
|
player = User.objects.create_user("username", password="password")
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ def test_can_access_own_character(client):
|
||||||
assert gm_notes not in body
|
assert gm_notes not in body
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_cant_access_random_character(client):
|
def test_cant_access_random_character(client):
|
||||||
player = User.objects.create_user("user", password="password")
|
player = User.objects.create_user("user", password="password")
|
||||||
other = User.objects.create_user("other", password="password")
|
other = User.objects.create_user("other", password="password")
|
||||||
|
@ -35,7 +35,7 @@ def test_cant_access_random_character(client):
|
||||||
assert res.status_code == HTTPStatus.NOT_FOUND
|
assert res.status_code == HTTPStatus.NOT_FOUND
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_can_access_character_in_party(client):
|
def test_can_access_character_in_party(client):
|
||||||
player = User.objects.create_user("user", password="password")
|
player = User.objects.create_user("user", password="password")
|
||||||
friend = User.objects.create_user("friend", password="password")
|
friend = User.objects.create_user("friend", password="password")
|
||||||
|
@ -61,7 +61,7 @@ def test_can_access_character_in_party(client):
|
||||||
assert gm_notes not in body
|
assert gm_notes not in body
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_game_master_can_access_character_in_party(client):
|
def test_game_master_can_access_character_in_party(client):
|
||||||
player = User.objects.create_user("user", password="password")
|
player = User.objects.create_user("user", password="password")
|
||||||
gm = User.objects.create_user("gm", password="password")
|
gm = User.objects.create_user("gm", password="password")
|
||||||
|
|
|
@ -12,7 +12,7 @@ from character.models import Character, Profile
|
||||||
from common.models import User
|
from common.models import User
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_create_character(selenium: WebDriver, live_server: LiveServer):
|
def test_create_character(selenium: WebDriver, live_server: LiveServer):
|
||||||
# Load fixtures
|
# Load fixtures
|
||||||
call_command("loaddata", "initial_data")
|
call_command("loaddata", "initial_data")
|
||||||
|
@ -93,7 +93,7 @@ def test_create_character(selenium: WebDriver, live_server: LiveServer):
|
||||||
assert getattr(character, name) == value
|
assert getattr(character, name) == value
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_change_health(selenium: WebDriver, live_server: LiveServer):
|
def test_change_health(selenium: WebDriver, live_server: LiveServer):
|
||||||
call_command("loaddata", "initial_data")
|
call_command("loaddata", "initial_data")
|
||||||
username, password = "user1", "some_password"
|
username, password = "user1", "some_password"
|
||||||
|
@ -157,7 +157,7 @@ def test_change_health(selenium: WebDriver, live_server: LiveServer):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_list_characters(selenium: WebDriver, live_server: LiveServer):
|
def test_list_characters(selenium: WebDriver, live_server: LiveServer):
|
||||||
# Load fixtures
|
# Load fixtures
|
||||||
call_command("loaddata", "initial_data")
|
call_command("loaddata", "initial_data")
|
||||||
|
@ -190,7 +190,7 @@ def test_list_characters(selenium: WebDriver, live_server: LiveServer):
|
||||||
assert names == expected_names
|
assert names == expected_names
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_delete_character(selenium: WebDriver, live_server: LiveServer):
|
def test_delete_character(selenium: WebDriver, live_server: LiveServer):
|
||||||
call_command("loaddata", "initial_data")
|
call_command("loaddata", "initial_data")
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ def test_delete_character(selenium: WebDriver, live_server: LiveServer):
|
||||||
assert Character.objects.filter(pk=characters[0].pk).first() is None
|
assert Character.objects.filter(pk=characters[0].pk).first() is None
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_reset_stats_view(
|
def test_reset_stats_view(
|
||||||
selenium: WebDriver,
|
selenium: WebDriver,
|
||||||
live_server: LiveServer,
|
live_server: LiveServer,
|
||||||
|
|
|
@ -8,7 +8,7 @@ def _collectstatic():
|
||||||
call_command("collectstatic", "--clear", "--noinput", "--verbosity=0")
|
call_command("collectstatic", "--clear", "--noinput", "--verbosity=0")
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture
|
||||||
def live_server(settings, live_server):
|
def live_server(settings, live_server):
|
||||||
settings.STORAGES = {
|
settings.STORAGES = {
|
||||||
"default": {"BACKEND": "django.core.files.storage.FileSystemStorage"},
|
"default": {"BACKEND": "django.core.files.storage.FileSystemStorage"},
|
||||||
|
@ -19,13 +19,13 @@ def live_server(settings, live_server):
|
||||||
return live_server
|
return live_server
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture
|
||||||
def firefox_options(firefox_options):
|
def firefox_options(firefox_options):
|
||||||
firefox_options.add_argument("-headless")
|
firefox_options.add_argument("-headless")
|
||||||
return firefox_options
|
return firefox_options
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture
|
||||||
def selenium(selenium: WebDriver) -> WebDriver:
|
def selenium(selenium: WebDriver) -> WebDriver:
|
||||||
selenium.implicitly_wait(3)
|
selenium.implicitly_wait(3)
|
||||||
selenium.set_window_size(3860, 2140)
|
selenium.set_window_size(3860, 2140)
|
||||||
|
@ -38,6 +38,6 @@ def settings(settings):
|
||||||
return settings
|
return settings
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture
|
||||||
def initial_data() -> None: # noqa: PT004
|
def initial_data() -> None:
|
||||||
call_command("loaddata", "initial_data")
|
call_command("loaddata", "initial_data")
|
||||||
|
|
|
@ -15,7 +15,7 @@ from common.models import User
|
||||||
from party.models import BattleEffect, Party
|
from party.models import BattleEffect, Party
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_add_character_to_existing_group(selenium: WebDriver, live_server: LiveServer):
|
def test_add_character_to_existing_group(selenium: WebDriver, live_server: LiveServer):
|
||||||
username, password = "gm", "password"
|
username, password = "gm", "password"
|
||||||
gm = User.objects.create_user(username, password=password)
|
gm = User.objects.create_user(username, password=password)
|
||||||
|
@ -39,7 +39,7 @@ def test_add_character_to_existing_group(selenium: WebDriver, live_server: LiveS
|
||||||
assert set(party.invited_characters.all()) == {character}
|
assert set(party.invited_characters.all()) == {character}
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_gm_observe_invited_character_in_group(
|
def test_gm_observe_invited_character_in_group(
|
||||||
selenium: WebDriver,
|
selenium: WebDriver,
|
||||||
live_server: LiveServer,
|
live_server: LiveServer,
|
||||||
|
@ -66,7 +66,7 @@ def test_gm_observe_invited_character_in_group(
|
||||||
assert title == character.name
|
assert title == character.name
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_gm_observe_invited_character_in_two_groups(
|
def test_gm_observe_invited_character_in_two_groups(
|
||||||
selenium: WebDriver,
|
selenium: WebDriver,
|
||||||
live_server: LiveServer,
|
live_server: LiveServer,
|
||||||
|
@ -95,7 +95,7 @@ def test_gm_observe_invited_character_in_two_groups(
|
||||||
assert title == character.name
|
assert title == character.name
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_reset_stats_view(
|
def test_reset_stats_view(
|
||||||
selenium: WebDriver,
|
selenium: WebDriver,
|
||||||
live_server: LiveServer,
|
live_server: LiveServer,
|
||||||
|
@ -125,7 +125,7 @@ def test_reset_stats_view(
|
||||||
assert character.luck_points_remaining == character.luck_points_max
|
assert character.luck_points_remaining == character.luck_points_max
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_player_can_add_effect_to_group(selenium: WebDriver, live_server: LiveServer):
|
def test_player_can_add_effect_to_group(selenium: WebDriver, live_server: LiveServer):
|
||||||
"""Any member of a group can add effects to the group."""
|
"""Any member of a group can add effects to the group."""
|
||||||
user, password = "player", "password"
|
user, password = "player", "password"
|
||||||
|
@ -154,7 +154,7 @@ def test_player_can_add_effect_to_group(selenium: WebDriver, live_server: LiveSe
|
||||||
assert effect.description in element.text
|
assert effect.description in element.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_gm_can_add_effect_to_group(selenium: WebDriver, live_server: LiveServer):
|
def test_gm_can_add_effect_to_group(selenium: WebDriver, live_server: LiveServer):
|
||||||
"""The GM of a group can add effects to the group."""
|
"""The GM of a group can add effects to the group."""
|
||||||
user, password = "gm", "password"
|
user, password = "gm", "password"
|
||||||
|
@ -183,7 +183,7 @@ def test_gm_can_add_effect_to_group(selenium: WebDriver, live_server: LiveServer
|
||||||
assert effect.description in element.text
|
assert effect.description in element.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_gm_can_change_remaining_rounds(selenium: WebDriver, live_server: LiveServer):
|
def test_gm_can_change_remaining_rounds(selenium: WebDriver, live_server: LiveServer):
|
||||||
"""The GM of a group can increase or decrease the remaining rounds of effects."""
|
"""The GM of a group can increase or decrease the remaining rounds of effects."""
|
||||||
user, password = "gm", "password"
|
user, password = "gm", "password"
|
||||||
|
@ -261,7 +261,7 @@ def test_gm_can_change_remaining_rounds(selenium: WebDriver, live_server: LiveSe
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db()
|
@pytest.mark.django_db
|
||||||
def test_gm_can_delete_any_existing_effect(
|
def test_gm_can_delete_any_existing_effect(
|
||||||
selenium: WebDriver,
|
selenium: WebDriver,
|
||||||
live_server: LiveServer,
|
live_server: LiveServer,
|
||||||
|
|
Loading…
Reference in a new issue