1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2024-12-27 08:22:21 +00:00
plateforme-corres2math/apps/api/tests.py

25 lines
731 B
Python
Raw Normal View History

2020-09-24 12:30:24 +00:00
from unittest.case import skipIf
from django.conf import settings
2020-09-24 12:15:42 +00:00
from django.contrib.auth.models import User
from django.test import TestCase
class TestAPIPages(TestCase):
def setUp(self):
self.user = User.objects.create_superuser(
username="admin",
password="apitest",
email="",
)
self.client.force_login(self.user)
def test_user_page(self):
response = self.client.get("/api/user/")
self.assertEqual(response.status_code, 200)
2020-09-24 12:30:24 +00:00
@skipIf("logs" not in settings.INSTALLED_APPS, reason="logs app is not used")
def test_logs_page(self):
response = self.client.get("/api/logs/")
self.assertEqual(response.status_code, 200)