mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-24 05:48:49 +02:00
Move apps in main directory
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
27
api/tests.py
Normal file
27
api/tests.py
Normal file
@ -0,0 +1,27 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from unittest.case import skipIf
|
||||
|
||||
from django.conf import settings
|
||||
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)
|
||||
|
||||
@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)
|
Reference in New Issue
Block a user