Skip to content

Commit c35b8b9

Browse files
committed
Update tests to allow local urls
1 parent 60f7722 commit c35b8b9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@ For more details see:
3232

3333
To install the RPI ws281x library:
3434

35-
sudo pip3 install rpi_ws281x
35+
pip3 install rpi_ws281x
3636

3737
To install the Argon hash algorithm
3838

3939
sudo apt install python3-argon2
4040

4141
To install the Flask CSRF protection
42-
sudo pip3 install Flask-WTF
42+
pip3 install Flask-WTF
43+
44+
To be able to run the tests
45+
sudo apt install python3-pytest
4346

4447

4548
It is recommended to install this program directly from git, which will allow for install of future updates. Note that updates will replace any custom sequences you have created. To provide support for different usernames I recommend installing into the /opt directory.

tests/functional/test_flask_1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ def test_index_2():
5252
with app.test_client() as test_client:
5353
response = test_client.get('/')
5454
assert response.status_code == 302
55-
assert response.location == "http://localhost/login"
55+
assert (response.location == "http://localhost/login") or (response.location == "/login")
5656

5757
# Not allowed
5858
def test_index_3():
5959
app = create_app(auth_config_none, auth_users_filename, _log_filename, debug=True)
6060
with app.test_client() as test_client:
6161
response = test_client.get('/')
6262
assert response.status_code == 302
63-
assert response.location == "http://localhost/invalid"
63+
assert (response.location == "http://localhost/invalid") or (response.location == "/invalid")
6464

6565
# Test proxy- authentication required
6666
def test_index_4():
@@ -71,7 +71,7 @@ def test_index_4():
7171
headers={'X-Real_IP': '192.168.0.22'}
7272
)
7373
assert response.status_code == 302
74-
assert response.location == "http://localhost/login"
74+
assert (response.location == "http://localhost/login") or (response.location == "/login")
7575

7676
# Test proxy - address not allowed
7777
def test_index_5():

0 commit comments

Comments
 (0)