Gender is not a date

This commit is contained in:
Yohann D'ANELLO 2021-01-22 09:04:44 +01:00
parent 74c0260593
commit 628f69e772
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 10 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# Generated by Django 3.0.11 on 2021-01-22 07:42
# Generated by Django 3.0.11 on 2021-01-22 08:00
from django.db import migrations, models
@ -13,6 +13,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='participantregistration',
name='gender',
field=models.DateField(choices=[('female', 'Female'), ('male', 'Male'), ('other', 'Other')], default='other', verbose_name='gender'),
field=models.CharField(choices=[('female', 'Female'), ('male', 'Male'), ('other', 'Other')], default='other', max_length=6, verbose_name='gender'),
),
]

View File

@ -128,7 +128,8 @@ class ParticipantRegistration(Registration):
default=date.today,
)
gender = models.DateField(
gender = models.CharField(
max_length=6,
verbose_name=_("gender"),
choices=[
("female", _("Female")),

View File

@ -130,6 +130,7 @@ class TestRegistration(TestCase):
student_class=12,
school="God",
birth_date="2000-01-01",
gender="other",
address="1 Rue de Rivoli, 75001 Paris, France",
phone_number="0123456789",
responsible_name="Toto",
@ -153,6 +154,7 @@ class TestRegistration(TestCase):
student_class=12,
school="God",
birth_date="2000-01-01",
gender="other",
address="1 Rue de Rivoli, 75001 Paris, France",
phone_number="0123456789",
responsible_name="Toto",
@ -173,6 +175,7 @@ class TestRegistration(TestCase):
password2="azertyuiopazertyuiop",
role="coach",
birth_date="1980-01-01",
gender="other",
address="1 Rue de Rivoli, 75001 Paris, France",
phone_number="0123456789",
professional_activity="God",
@ -252,10 +255,10 @@ class TestRegistration(TestCase):
for user, data in [(self.user, dict(role="Bot")),
(self.student, dict(student_class=11, school="Sky", birth_date="2001-01-01",
address="1 Rue de Rivoli, 75001 Paris, France", responsible_name="Toto",
responsible_email="toto@example.com")),
gender="female", address="1 Rue de Rivoli, 75001 Paris, France",
responsible_name="Toto", responsible_email="toto@example.com")),
(self.coach, dict(professional_activity="God", birth_date="2001-01-01",
address="1 Rue de Rivoli, 75001 Paris, France"))]:
gender="male", address="1 Rue de Rivoli, 75001 Paris, France"))]:
response = self.client.get(reverse("registration:update_user", args=(user.pk,)))
self.assertEqual(response.status_code, 200)