fix: fix gas urls, bump version 0.8.9
This commit is contained in:
parent
6f2895253b
commit
4d82c76fbd
|
@ -1,6 +1,11 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
0.8.9
|
||||
-----
|
||||
|
||||
* Bugfix
|
||||
|
||||
0.8.8
|
||||
-----
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ class GASSite:
|
|||
for prefix, urls in self._registry['urls'].items():
|
||||
if prefix:
|
||||
urlpatterns.append(
|
||||
re_path(r'^{prefix}/', include(urls)),
|
||||
re_path(f'^{prefix}/', include(urls)),
|
||||
)
|
||||
else:
|
||||
urlpatterns.append(
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
from django.test import TestCase, Client
|
||||
from django.urls import reverse
|
||||
|
||||
from model_bakery import baker
|
||||
|
||||
from gas.gas.core.views import GASLoginView
|
||||
|
||||
|
||||
class GASLoginTestCase(TestCase):
|
||||
def test_load(self):
|
||||
client = Client()
|
||||
response = client.get(reverse('gas:login'))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
class IndexTestCase(TestCase):
|
||||
def test_load(self):
|
||||
admin_user = baker.make(
|
||||
'auth.User',
|
||||
username='admin',
|
||||
is_superuser=True,
|
||||
)
|
||||
|
||||
client = Client()
|
||||
response = client.get(reverse('gas:index'))
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
||||
client.force_login(admin_user)
|
||||
response = client.get(reverse('gas:index'))
|
||||
self.assertEqual(response.status_code, 200)
|
Loading…
Reference in New Issue