diff --git a/Website/__init__.py b/Website/__init__.py index 497fcc6..1c585ad 100644 --- a/Website/__init__.py +++ b/Website/__init__.py @@ -1,5 +1,5 @@ import queue, time, uuid, json, logging, datetime, os -from flask import Flask, render_template, request, make_response, session, url_for, g +from flask import Flask, render_template, request, make_response, session, send_file, g from flask_socketio import SocketIO, join_room, leave_room from flask_session import Session from markupsafe import escape @@ -49,11 +49,11 @@ def create_app(test_config=None): #website @app.route('/favicon.ico') def favicon(): - return url_for('static', filename='Logo_CCC.svg.png') + return send_file("../static/Logo_CCC.svg.png") - @app.route('/socket.io.js') - def socketiojs(): - return url_for('static', filename='socket.io.js') + #@app.route('/socket.io.js') + #def socketiojs(): + # return url_for('static', filename='socket.io.js') @app.route("/") def index(): diff --git a/Website/__pycache__/__init__.cpython-311.pyc b/Website/__pycache__/__init__.cpython-311.pyc index 385456e..d5af4ff 100644 Binary files a/Website/__pycache__/__init__.cpython-311.pyc and b/Website/__pycache__/__init__.cpython-311.pyc differ diff --git a/tests/__pycache__/test_website.cpython-311-pytest-7.4.0.pyc b/tests/__pycache__/test_website.cpython-311-pytest-7.4.0.pyc index 2507cf6..37b5f78 100644 Binary files a/tests/__pycache__/test_website.cpython-311-pytest-7.4.0.pyc and b/tests/__pycache__/test_website.cpython-311-pytest-7.4.0.pyc differ diff --git a/tests/test_website.py b/tests/test_website.py index 34dfe36..3af725e 100644 --- a/tests/test_website.py +++ b/tests/test_website.py @@ -12,6 +12,11 @@ def test_config(): assert not create_app()["app"].testing assert create_app({'TESTING': True})["app"].testing +#basic tests +def test_favicon(client): + response = client.get("/favicon.ico") + assert response.status_code == 200 + #/adduser def test_adduser(client): response = client.get('/adduser/user')