6 Commits

Author SHA1 Message Date
687ed01f31 Merge pull request 'feature/issue7' (#7) from feature/issue7 into QA
Reviewed-on: #7
2025-07-09 15:54:36 +00:00
2ed9720e18 Merge pull request 'bug/issue6' (#6) from bug/issue6 into QA
Reviewed-on: #6
2025-07-09 15:53:28 +00:00
9e3e049535 template fixed, 2 tests on display 2025-07-09 12:30:10 +02:00
811c635a47 Merge branch 'QA' of github.com:ylxdre/OCR-P11-Testing into feature/issue7
branch created earlier : retrieve base code
2025-07-09 11:54:08 +02:00
db692a068e Merge pull request #8 from ylxdre/bug/issue6
Bug/issue6
2025-07-08 16:58:04 +02:00
2dc85f19e7 added public list of club`s points 2025-06-26 15:11:13 +02:00
4 changed files with 47 additions and 1 deletions

View File

@@ -84,7 +84,9 @@ def purchasePlaces():
competitions=competitions, now=now) competitions=competitions, now=now)
# TODO: Add route for points display # TODO: Add route for points display
@app.route('/points')
def displayPoints():
return render_template('points.html', clubs=clubs)
@app.route('/logout') @app.route('/logout')
def logout(): def logout():

View File

@@ -22,5 +22,6 @@
<input type="email" name="email" id=""/> <input type="email" name="email" id=""/>
<button type="submit">Enter</button> <button type="submit">Enter</button>
</form> </form>
<a href="{{ url_for('displayPoints') }}">Board of points</a>
</body> </body>
</html> </html>

19
templates/points.html Normal file
View File

@@ -0,0 +1,19 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Board of clubs and points || GUDLFT</title>
</head>
<body>
<h2>Current points</h2>
<ul>
{% for club in clubs %}
<li><strong>club : </strong> {{club['name']}} </br>
<strong>Points : </strong>{{club['points']}}</br>
</br>
</li>
{% endfor %}
</ul>
<a href="{{ url_for('index') }}"> Back </a>
</body>
</html>

24
tests/test_board.py Normal file
View File

@@ -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)