mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 09:18:23 +02:00
Fix broken tests
This commit is contained in:
@ -14,7 +14,13 @@
|
||||
<dd class="col-sm-10"><a href="{% url "participation:team_detail" pk=participation.team.pk %}">{{ participation.team }}</a></dd>
|
||||
|
||||
<dt class="col-sm-2">{% trans "Tournament:" %}</dt>
|
||||
<dd class="col-sm-10"><a href="{% url "participation:tournament_detail" pk=participation.tournament.pk %}">{{ participation.tournament }}</a></dd>
|
||||
<dd class="col-sm-10">
|
||||
{% if participation.tournament %}
|
||||
<a href="{% url "participation:tournament_detail" pk=participation.tournament.pk %}">{{ participation.tournament }}</a>
|
||||
{% else %}
|
||||
{% trans "any" %}
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-2">{% trans "Solutions:" %}</dt>
|
||||
<dd class="col-sm-10">
|
||||
|
@ -41,8 +41,13 @@
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-6 text-right">{% trans "Tournament:" %}</dt>
|
||||
{% trans "any" as any %}
|
||||
<dd class="col-sm-6"><a href="{% url "participation:tournament_detail" pk=team.participation.tournament.pk %}">{{ team.participation.tournament|default:any }}</a></dd>
|
||||
<dd class="col-sm-6">
|
||||
{% if team.participation.tournament %}
|
||||
<a href="{% url "participation:tournament_detail" pk=team.participation.tournament.pk %}">{{ team.participation.tournament }}</a>
|
||||
{% else %}
|
||||
{% trans "any" %}
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-6 text-right">{% trans "Photo authorizations:" %}</dt>
|
||||
<dd class="col-sm-6">
|
||||
|
@ -210,6 +210,8 @@ class TestStudentParticipation(TestCase):
|
||||
email_confirmed=True,
|
||||
team=self.team,
|
||||
photo_authorization="authorization/photo/mai-linh",
|
||||
health_sheet="authorization/health/mai-linh",
|
||||
parental_authorization="authorization/parental/mai-linh",
|
||||
)
|
||||
|
||||
third_user = User.objects.create(
|
||||
@ -226,8 +228,34 @@ class TestStudentParticipation(TestCase):
|
||||
email_confirmed=True,
|
||||
team=self.team,
|
||||
photo_authorization="authorization/photo/yohann",
|
||||
health_sheet="authorization/health/yohann",
|
||||
parental_authorization="authorization/parental/yohann",
|
||||
)
|
||||
|
||||
fourth_user = User.objects.create(
|
||||
first_name="tfjm",
|
||||
last_name="tfjm",
|
||||
email="tfjm@example.com",
|
||||
password="tfjm",
|
||||
)
|
||||
StudentRegistration.objects.create(
|
||||
user=fourth_user,
|
||||
student_class=10,
|
||||
school="Sun",
|
||||
give_contact_to_animath=False,
|
||||
email_confirmed=True,
|
||||
team=self.team,
|
||||
photo_authorization="authorization/photo/tfjm",
|
||||
health_sheet="authorization/health/tfjm",
|
||||
parental_authorization="authorization/parental/tfjm",
|
||||
)
|
||||
|
||||
self.coach.registration.team = self.team
|
||||
self.coach.registration.health_sheet = "authorization/health/coach"
|
||||
self.coach.registration.photo_authorization = "authorization/photo/coach"
|
||||
self.coach.registration.email_confirmed = True
|
||||
self.coach.registration.save()
|
||||
|
||||
self.client.force_login(self.superuser)
|
||||
# Admin users can't ask for validation
|
||||
resp = self.client.post(reverse("participation:team_detail", args=(self.team.pk,)), data=dict(
|
||||
@ -251,6 +279,8 @@ class TestStudentParticipation(TestCase):
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
|
||||
self.user.registration.photo_authorization = "authorization/photo/ananas"
|
||||
self.user.registration.health_sheet = "authorization/health/ananas"
|
||||
self.user.registration.parental_authorization = "authorization/parental/ananas"
|
||||
self.user.registration.save()
|
||||
|
||||
resp = self.client.get(reverse("participation:team_detail", args=(self.team.pk,)))
|
||||
|
Reference in New Issue
Block a user