PyInventory/inventory_tests/test_admin.py

18 wiersze
547 B
Python
Czysty Zwykły widok Historia

2020-10-16 15:54:34 +00:00
import pytest
from django.test import TestCase
@pytest.mark.django_db
class AdminAnonymousTests(TestCase):
"""
Anonymous will be redirected to the login page.
"""
def test_login_en(self):
2020-10-16 18:30:09 +00:00
response = self.client.get("/admin/", HTTP_ACCEPT_LANGUAGE="en")
self.assertRedirects(response, expected_url="/admin/login/?next=/admin/")
2020-10-16 15:54:34 +00:00
def test_login_de(self):
2020-10-16 18:30:09 +00:00
response = self.client.get("/admin/", HTTP_ACCEPT_LANGUAGE="de")
self.assertRedirects(response, expected_url="/admin/login/?next=/admin/")