🔧(backend) add FRONTEND_THEME setting
The frontend need to know the theme to be used, so we need to add a new setting to the backend, in order to expose this value to the frontend.
This commit is contained in:
@@ -16,9 +16,10 @@ pytestmark = pytest.mark.django_db
|
||||
|
||||
|
||||
@override_settings(
|
||||
SENTRY_DSN="https://sentry.test/123",
|
||||
MEDIA_BASE_URL="http://testserver/",
|
||||
COLLABORATION_SERVER_URL="http://testcollab/",
|
||||
FRONTEND_THEME="test-theme",
|
||||
MEDIA_BASE_URL="http://testserver/",
|
||||
SENTRY_DSN="https://sentry.test/123",
|
||||
)
|
||||
def test_api_config_anonymous():
|
||||
"""Anonymous users should be allowed to get the configuration."""
|
||||
@@ -27,18 +28,20 @@ def test_api_config_anonymous():
|
||||
assert response.status_code == HTTP_200_OK
|
||||
assert response.json() == {
|
||||
"COLLABORATION_SERVER_URL": "http://testcollab/",
|
||||
"ENVIRONMENT": "test",
|
||||
"FRONTEND_THEME": "test-theme",
|
||||
"LANGUAGES": [["en-us", "English"], ["fr-fr", "French"], ["de-de", "German"]],
|
||||
"LANGUAGE_CODE": "en-us",
|
||||
"SENTRY_DSN": "https://sentry.test/123",
|
||||
"ENVIRONMENT": "test",
|
||||
"MEDIA_BASE_URL": "http://testserver/",
|
||||
"SENTRY_DSN": "https://sentry.test/123",
|
||||
}
|
||||
|
||||
|
||||
@override_settings(
|
||||
SENTRY_DSN="https://sentry.test/123",
|
||||
MEDIA_BASE_URL="http://testserver/",
|
||||
COLLABORATION_SERVER_URL="http://testcollab/",
|
||||
FRONTEND_THEME="test-theme",
|
||||
MEDIA_BASE_URL="http://testserver/",
|
||||
SENTRY_DSN="https://sentry.test/123",
|
||||
)
|
||||
def test_api_config_authenticated():
|
||||
"""Authenticated users should be allowed to get the configuration."""
|
||||
@@ -51,9 +54,10 @@ def test_api_config_authenticated():
|
||||
assert response.status_code == HTTP_200_OK
|
||||
assert response.json() == {
|
||||
"COLLABORATION_SERVER_URL": "http://testcollab/",
|
||||
"ENVIRONMENT": "test",
|
||||
"FRONTEND_THEME": "test-theme",
|
||||
"MEDIA_BASE_URL": "http://testserver/",
|
||||
"LANGUAGES": [["en-us", "English"], ["fr-fr", "French"], ["de-de", "German"]],
|
||||
"LANGUAGE_CODE": "en-us",
|
||||
"SENTRY_DSN": "https://sentry.test/123",
|
||||
"ENVIRONMENT": "test",
|
||||
"MEDIA_BASE_URL": "http://testserver/",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user