diff --git a/backend/secfit/users/tests.py b/backend/secfit/users/tests.py index 7ce503c2dd97ba78597f6ff6e4393132753573f6..da6ff2a3f79a03e1a964a3b7a8a5460dbc7cdc59 100644 --- a/backend/secfit/users/tests.py +++ b/backend/secfit/users/tests.py @@ -1,3 +1,23 @@ +import json + +from django.contrib.auth.models import User +from django.urls import reverse +from rest_framework import status +from rest_framework.authtoken.models import Token +from rest_framework.test import APITestCase + +from users.serializers import UserSerializer +from users.models import User + from django.test import TestCase -# Create your tests here. +class RegistrationTestCase(APITestCase): + + def test_registration(self): + data = {"username": "testcase", "email": "test@test.no", + "password": "strong_pwd", "password1": "strong_pwd", + "phone_number": "95080764", "country": "Norway", + "city": "Trondheim", "street_address": "Tors Veg 11C"} + response = self.client.post("/api/users/", data) + self.assertEqual(response.status_code, status.HTTP_201_CREATED) +