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): ...@@ -10,12 +10,10 @@ class GuestRegisterSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = Person model = Person
fields = ("id", "first_name", "last_name", "date_of_birth") fields = ("id", "first_name", "last_name", "email")
read_only_fields = ("id",) read_only_fields = ("id",)
extra_kwargs = { extra_kwargs = {
"first_name": {"required": True}, "first_name": {"required": True},
"last_name": {"required": True}, "last_name": {"required": True},
"date_of_birth": {"required": True}, "email": {"required": True},
# 'email': {'required': True},
# 'phone_number': {'required': True},
} }
...@@ -6,7 +6,7 @@ from rest_framework.reverse import reverse ...@@ -6,7 +6,7 @@ from rest_framework.reverse import reverse
@pytest.mark.django_db @pytest.mark.django_db
def test_register_guest(client): 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") url = reverse("gregui-v1:guest-register")
response = client.post(url, data) response = client.post(url, data)
assert response.status_code == status.HTTP_201_CREATED 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