mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-11-22 14:38:03 +01:00
Compare commits
No commits in common. "7351af53db0abb0633825ab5e3a55885ad6c0895" and "730e253d00ba42c6ed1a64f82f1bacfcbe9e204a" have entirely different histories.
7351af53db
...
730e253d00
8 changed files with 30 additions and 30 deletions
|
@ -40,7 +40,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: djhtml
|
- id: djhtml
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.6.1
|
rev: v0.5.7
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix]
|
args: [--fix]
|
||||||
|
|
|
@ -53,7 +53,7 @@ idna==3.7
|
||||||
# via
|
# via
|
||||||
# requests
|
# requests
|
||||||
# trio
|
# trio
|
||||||
markdown==3.7
|
markdown==3.6
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
outcome==1.3.0.post0
|
outcome==1.3.0.post0
|
||||||
# via trio
|
# via trio
|
||||||
|
|
|
@ -54,7 +54,7 @@ django==5.1
|
||||||
# django-browser-reload
|
# django-browser-reload
|
||||||
# django-debug-toolbar
|
# django-debug-toolbar
|
||||||
# model-bakery
|
# model-bakery
|
||||||
django-browser-reload==1.15.0
|
django-browser-reload==1.13.0
|
||||||
# via -r requirements-dev.in
|
# via -r requirements-dev.in
|
||||||
django-debug-toolbar==4.4.6
|
django-debug-toolbar==4.4.6
|
||||||
# via -r requirements-dev.in
|
# via -r requirements-dev.in
|
||||||
|
@ -66,7 +66,7 @@ h11==0.14.0
|
||||||
# via
|
# via
|
||||||
# -c constraints.txt
|
# -c constraints.txt
|
||||||
# wsproto
|
# wsproto
|
||||||
hypothesis==6.111.1
|
hypothesis==6.111.0
|
||||||
# via -r requirements-dev.in
|
# via -r requirements-dev.in
|
||||||
identify==2.6.0
|
identify==2.6.0
|
||||||
# via pre-commit
|
# via pre-commit
|
||||||
|
@ -83,7 +83,7 @@ jinja2==3.1.4
|
||||||
# via pytest-html
|
# via pytest-html
|
||||||
markupsafe==2.1.5
|
markupsafe==2.1.5
|
||||||
# via jinja2
|
# via jinja2
|
||||||
model-bakery==1.19.3
|
model-bakery==1.19.1
|
||||||
# via -r requirements-dev.in
|
# via -r requirements-dev.in
|
||||||
mypy-extensions==1.0.0
|
mypy-extensions==1.0.0
|
||||||
# via black
|
# via black
|
||||||
|
@ -155,7 +155,7 @@ requests==2.32.3
|
||||||
# bpython
|
# bpython
|
||||||
# pytest-base-url
|
# pytest-base-url
|
||||||
# pytest-selenium
|
# pytest-selenium
|
||||||
ruff==0.6.1
|
ruff==0.5.7
|
||||||
# via -r requirements-dev.in
|
# via -r requirements-dev.in
|
||||||
selenium==4.23.1
|
selenium==4.23.1
|
||||||
# via
|
# via
|
||||||
|
@ -215,5 +215,5 @@ wsproto==1.2.0
|
||||||
# The following packages are considered to be unsafe in a requirements file:
|
# The following packages are considered to be unsafe in a requirements file:
|
||||||
pip==24.2
|
pip==24.2
|
||||||
# via pip-tools
|
# via pip-tools
|
||||||
setuptools==72.2.0
|
setuptools==72.1.0
|
||||||
# via pip-tools
|
# via pip-tools
|
||||||
|
|
|
@ -53,7 +53,7 @@ idna==3.7
|
||||||
# via
|
# via
|
||||||
# requests
|
# requests
|
||||||
# trio
|
# trio
|
||||||
markdown==3.7
|
markdown==3.6
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
outcome==1.3.0.post0
|
outcome==1.3.0.post0
|
||||||
# via trio
|
# via trio
|
||||||
|
|
|
@ -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:
|
def initial_data() -> None: # noqa: PT004
|
||||||
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