From 9fe0bcfc58c96b74767d7f3a960fbb5d2683c141 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 26 Nov 2022 03:39:53 +0200 Subject: [PATCH] compliment aeb1916b0136e937d3f0c4ccb490390e57d9231b --- .gitignore | 1 - files/tests/test_e2e.py | 37 ------------------------------------- requirements.txt | 1 - 3 files changed, 39 deletions(-) delete mode 100644 files/tests/test_e2e.py diff --git a/.gitignore b/.gitignore index 560f817d7..ef6e05bf0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ unsanitized.mp4 cache/ __pycache__/ .idea/ -**/.pytest_cache/ venv/ .vscode/ .sass-cache/ diff --git a/files/tests/test_e2e.py b/files/tests/test_e2e.py deleted file mode 100644 index 00ede0ccf..000000000 --- a/files/tests/test_e2e.py +++ /dev/null @@ -1,37 +0,0 @@ -from bs4 import BeautifulSoup -from time import time, sleep -from files.__main__ import app - -# these tests require `docker-compose up` first - -def test_rules(): - response = app.test_client().get("/sidebar") - assert response.status_code == 200 - assert response.text.startswith("") - - -def test_signup(): - client = app.test_client() - with client: # this keeps the session between requests, which we need - signup_get_response = client.get("/signup") - assert signup_get_response.status_code == 200 - soup = BeautifulSoup(signup_get_response.text, 'html.parser') - # these hidden input values seem to be used for anti-bot purposes and need to be submitted - formkey = next(tag for tag in soup.find_all("input") if tag.get("name") == "formkey").get("value") - form_timestamp = next(tag for tag in soup.find_all("input") if tag.get("name") == "now").get("value") - - sleep(5) # too-fast submissions are rejected (bot check?) - username = "testuser" + str(round(time())) - signup_post_response = client.post("/signup", data={ - "username": username, - "password": "password", - "password_confirm": "password", - "email": "", - "formkey": formkey, - "now": form_timestamp - }) - print(f"Signing up as {username}", flush=True) - assert signup_post_response.status_code == 302 - assert "error" not in signup_post_response.location - - # we should now be logged in and able to post diff --git a/requirements.txt b/requirements.txt index 258d80ac3..ad4a75c58 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,7 +28,6 @@ tldextract user-agents psycopg2-binary pusher_push_notifications -pytest youtube-dl yattag webptools