c3lf-system-3/core/authentication/tests/v2/test_users.py

19 lines
645 B
Python
Raw Normal View History

2023-11-23 22:17:20 +00:00
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)