gas-drf/gas_drf/tests/test_site.py

23 lines
634 B
Python
Raw Normal View History

2022-03-21 17:48:13 +01:00
from django.test import TestCase
from django.urls import reverse
from gas_drf.sites import GASDRFSite
class SiteTestCase(TestCase):
def test_register(self):
from gas_drf.gas.users.api_views import UserViewSet
test_site = GASDRFSite()
test_site.register('users-test', UserViewSet, basename='gas-user-test')
registered_url_names = [
url.name for url in test_site.urls
]
self.assertIn('gas-user-test-list', registered_url_names)
class SampleAppIntegrationTest(TestCase):
def test_gas_autodiscover(self):
# urls registered
reverse('gas-user-list')