[codestyle] rename variable

This commit is contained in:
bronsen 2025-03-15 22:48:43 +01:00
parent 7c825e15cf
commit a0a2b1ea53
2 changed files with 3 additions and 3 deletions

View file

@ -15,6 +15,7 @@ def enable_db_access_for_all_tests(db):
def fixture_longlived_client() -> Client:
return Client()
@pytest.fixture(name="random_name", scope="session")
def fixture_random_name_generator() -> Callable[[int], str]:
def name_generator(length: int = 7) -> str:
@ -22,4 +23,3 @@ def fixture_random_name_generator() -> Callable[[int], str]:
return name
return name_generator

View file

@ -44,9 +44,9 @@ def test_entering_same_name_twice_does_not_change_database_entry(data, session:
def test_enter_endpoint_accepts_only_post_requests(
client: Client, http_method: str, expected_status: int, random_name: Callable[[int], str]
):
request_method = getattr(client, http_method.lower())
client_method = getattr(client, http_method.lower())
response = request_method(
response = client_method(
reverse("collector:enter"), data={"new_name": random_name(8)}
)
assert response.status_code == expected_status