Skip to content
Snippets Groups Projects
Verified Commit d36edfc0 authored by ynerant's avatar ynerant
Browse files

Linting


Signed-off-by: ynerant's avatarYohann D'ANELLO <ynerant@crans.org>
parent e452b7ac
No related branches found
No related tags found
2 merge requests!174OAuth2, tests WEI,!173[WEI] Correction de l'algorithme et tests unitaires
Pipeline #9026 passed with stages
in 23 minutes and 2 seconds
...@@ -16,7 +16,7 @@ WORDS = [ ...@@ -16,7 +16,7 @@ WORDS = [
'Fanfare', 'Fracassage', 'Féria', 'Hard rock', 'Hoeggarden', 'House', 'Huit-six', 'IPA', 'Inclusif', 'Inferno', 'Fanfare', 'Fracassage', 'Féria', 'Hard rock', 'Hoeggarden', 'House', 'Huit-six', 'IPA', 'Inclusif', 'Inferno',
'Introverti', 'Jager bomb', 'Jazz', 'Jeux d\'alcool', 'Jeux de rôles', 'Jeux vidéo', 'Jul', 'Jus de fruit', 'Introverti', 'Jager bomb', 'Jazz', 'Jeux d\'alcool', 'Jeux de rôles', 'Jeux vidéo', 'Jul', 'Jus de fruit',
'Karaoké', 'LGBTQI+', 'Lady Gaga', 'Loup garou', 'Morning beer', 'Métal', 'Nuit blanche', 'Ovalie', 'Psychedelic', 'Karaoké', 'LGBTQI+', 'Lady Gaga', 'Loup garou', 'Morning beer', 'Métal', 'Nuit blanche', 'Ovalie', 'Psychedelic',
'Pétanque', 'Rave', 'Reggae', 'Rhum', 'Ricard', 'Rock', 'Rosé', 'Rétro', 'Séducteur', 'Techno', 'Thérapie taxi', 'Pétanque', 'Rave', 'Reggae', 'Rhum', 'Ricard', 'Rock', 'Rosé', 'Rétro', 'Séducteur', 'Techno', 'Thérapie taxi',
'Théâtre', 'Trap', 'Turn up', 'Underground', 'Volley', 'Wati B', 'Zinédine Zidane', 'Théâtre', 'Trap', 'Turn up', 'Underground', 'Volley', 'Wati B', 'Zinédine Zidane',
] ]
...@@ -45,9 +45,9 @@ class WEISurveyForm2021(forms.Form): ...@@ -45,9 +45,9 @@ class WEISurveyForm2021(forms.Form):
rng = Random(information.seed) rng = Random(information.seed)
words = [] words = []
for _ in range(information.step + 1): for _ignored in range(information.step + 1):
# Generate N times words # Generate N times words
words = [rng.choice(WORDS) for _ in range(10)] words = [rng.choice(WORDS) for _ignored2 in range(10)]
words = [(w, w) for w in words] words = [(w, w) for w in words]
if self.data: if self.data:
self.fields["word"].choices = [(w, w) for w in WORDS] self.fields["word"].choices = [(w, w) for w in WORDS]
...@@ -162,7 +162,7 @@ class WEISurveyAlgorithm2021(WEISurveyAlgorithm): ...@@ -162,7 +162,7 @@ class WEISurveyAlgorithm2021(WEISurveyAlgorithm):
while free_surveys: # Some students are not affected while free_surveys: # Some students are not affected
survey = free_surveys[0] survey = free_surveys[0]
buses = survey.ordered_buses() # Preferences of the student buses = survey.ordered_buses() # Preferences of the student
for bus, _ in buses: for bus, _ignored in buses:
if self.get_bus_information(bus).has_free_seats(surveys): if self.get_bus_information(bus).has_free_seats(surveys):
# Selected bus has free places. Put student in the bus # Selected bus has free places. Put student in the bus
survey.select_bus(bus) survey.select_bus(bus)
......
...@@ -5,7 +5,7 @@ from argparse import ArgumentParser, FileType ...@@ -5,7 +5,7 @@ from argparse import ArgumentParser, FileType
from django.core.management import BaseCommand from django.core.management import BaseCommand
from django.db import transaction from django.db import transaction
from wei.forms import CurrentSurvey from ...forms import CurrentSurvey
class Command(BaseCommand): class Command(BaseCommand):
......
import math # Copyright (C) 2018-2021 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
import random import random
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.test import TestCase from django.test import TestCase
from wei.forms.surveys.wei2021 import WEIBusInformation2021, WEISurvey2021, WORDS, WEISurveyInformation2021 from ..forms.surveys.wei2021 import WEIBusInformation2021, WEISurvey2021, WORDS, WEISurveyInformation2021
from wei.models import Bus, WEIClub, WEIRegistration from ..models import Bus, WEIClub, WEIRegistration
class TestWEIAlgorithm(TestCase): class TestWEIAlgorithm(TestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment