Exemplo n.º 1
0
 def test_lowercase_model_name_not_snaked(self):
     assert model_name_to_snake(
         LOWER_CASE_MODEL_NAME) == LOWER_CASE_MODEL_NAME
Exemplo n.º 2
0
 def test_empty_string_snake_case_returns_nothing(self):
     assert model_name_to_snake(empty_string) == ''
Exemplo n.º 3
0
 def test_model_name_to_snake_case(self):
     assert model_name_to_snake(
         CAMEL_CASE_MODEL_NAME) == SNAKE_CASE_MODEL_NAME
Exemplo n.º 4
0
    CalendarReminderView,
    AlgoliaApiKeyView,
    GeneralViewSet,
    IndexView,
    JWTCookieNameView,
)
from .views.general_view_set import MODELS_TO_EXCLUDE_FROM_URL_BINDING

accelerator_router = routers.DefaultRouter()
simpleuser_router = routers.DefaultRouter()
simpleuser_router.register('User', GeneralViewSet, base_name='User')

for model in apps.get_models('accelerator'):
    if (model._meta.app_label == 'accelerator' and not model._meta.auto_created
            and model.__name__ not in MODELS_TO_EXCLUDE_FROM_URL_BINDING):
        schema_router.register(model, url=model_name_to_snake(model.__name__))

sso_urlpatterns = [
    url(r'^api-token-auth/', obtain_jwt_token),
    url(r'^api-token-refresh/', refresh_jwt_token),
    url(r'^api-token-verify/', verify_jwt_token),
]

account_urlpatterns = [
    url(r'^', include('registration.backends.simple.urls')),
]

urls = [
    url(r'^api/sso/token_name/',
        JWTCookieNameView.as_view(),
        name=JWTCookieNameView.view_name),