diff --git a/server.py b/server.py index dc9ea82..299b935 100644 --- a/server.py +++ b/server.py @@ -84,7 +84,9 @@ def purchasePlaces(): competitions=competitions, now=now) # TODO: Add route for points display - +@app.route('/points') +def displayPoints(): + return render_template('points.html', clubs=clubs) @app.route('/logout') def logout(): diff --git a/templates/index.html b/templates/index.html index 5bd9351..1340581 100644 --- a/templates/index.html +++ b/templates/index.html @@ -22,5 +22,6 @@ + Board of points diff --git a/templates/points.html b/templates/points.html new file mode 100644 index 0000000..abc6e53 --- /dev/null +++ b/templates/points.html @@ -0,0 +1,19 @@ + + + + + Board of clubs and points || GUDLFT + + +

Current points

+ + Back + + diff --git a/tests/test_board.py b/tests/test_board.py new file mode 100644 index 0000000..6fbb33e --- /dev/null +++ b/tests/test_board.py @@ -0,0 +1,24 @@ +from bs4 import BeautifulSoup +from server import loadClubs + + +class TestBoardDisplayPoints: + + def test_should_get_200(self, client): + ''' + test if the page is retrieved + ''' + response = client.get('/points') + assert response.status_code == 200 + + def test_should_display_right_size_list(self, client): + ''' + test if the list of club displayed and in DB have the same size + ''' + list_club = loadClubs() + response = client.get('/points') + soup = BeautifulSoup(response.data, "html.parser") + li = soup.find_all("li") + assert len(li) == len(list_club) + +