Skip to content
Snippets Groups Projects
Commit ec1248f2 authored by Tore.Brede's avatar Tore.Brede
Browse files

Merge branch 'GREG-60_update_which_fields_are_required' into 'master'

GREG-60: Updating which fields are requried

See merge request !87
parents 6d14c45d 5954d19c
No related branches found
No related tags found
1 merge request!87GREG-60: Updating which fields are requried
Pipeline #95855 passed
......@@ -10,12 +10,10 @@ class GuestRegisterSerializer(serializers.ModelSerializer):
class Meta:
model = Person
fields = ("id", "first_name", "last_name", "date_of_birth")
fields = ("id", "first_name", "last_name", "email")
read_only_fields = ("id",)
extra_kwargs = {
"first_name": {"required": True},
"last_name": {"required": True},
"date_of_birth": {"required": True},
# 'email': {'required': True},
# 'phone_number': {'required': True},
"email": {"required": True},
}
......@@ -6,7 +6,7 @@ from rest_framework.reverse import reverse
@pytest.mark.django_db
def test_register_guest(client):
data = {"first_name": "Foo", "last_name": "Bar", "date_of_birth": "2020-09-21"}
data = {"first_name": "Foo", "last_name": "Bar", "email": "test@example.com"}
url = reverse("gregui-v1:guest-register")
response = client.post(url, data)
assert response.status_code == status.HTTP_201_CREATED
......
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