c3lf-system-3/core/authentication/tests/v2/test_users.py
2024-01-07 17:50:12 +01:00

18 lines
645 B
Python

from django.test import TestCase, Client
from core import settings
client = Client()
class IssueApiTest(TestCase):
def test_issues(self):
response = client.get('/api/2/users/')
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.json()), 1)
self.assertEqual(response.json()[0]['username'], settings.LEGACY_USER_NAME)
self.assertEqual(response.json()[0]['email'], 'mail@' + settings.MAIL_DOMAIN)
self.assertEqual(response.json()[0]['first_name'], '')
self.assertEqual(response.json()[0]['last_name'], '')
self.assertEqual(response.json()[0]['id'], 1)