Tests for app_logo
This commit is contained in:
parent
97e25f26aa
commit
60f37090d9
@ -50,6 +50,7 @@ class TestApiAppConfig(DirectoriesMixin, APITestCase):
|
|||||||
"max_image_pixels": None,
|
"max_image_pixels": None,
|
||||||
"color_conversion_strategy": None,
|
"color_conversion_strategy": None,
|
||||||
"app_title": None,
|
"app_title": None,
|
||||||
|
"app_logo": None,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -57,19 +58,21 @@ class TestApiAppConfig(DirectoriesMixin, APITestCase):
|
|||||||
def test_api_get_ui_settings_with_config(self):
|
def test_api_get_ui_settings_with_config(self):
|
||||||
"""
|
"""
|
||||||
GIVEN:
|
GIVEN:
|
||||||
- Existing config with app_title specified
|
- Existing config with app_title, app_logo specified
|
||||||
WHEN:
|
WHEN:
|
||||||
- API to retrieve uisettings is called
|
- API to retrieve uisettings is called
|
||||||
THEN:
|
THEN:
|
||||||
- app_title is included
|
- app_title and app_logo are included
|
||||||
"""
|
"""
|
||||||
config = ApplicationConfiguration.objects.first()
|
config = ApplicationConfiguration.objects.first()
|
||||||
config.app_title = "Fancy New Title"
|
config.app_title = "Fancy New Title"
|
||||||
|
config.app_logo = "/logo/example.jpg"
|
||||||
config.save()
|
config.save()
|
||||||
response = self.client.get("/api/ui_settings/", format="json")
|
response = self.client.get("/api/ui_settings/", format="json")
|
||||||
self.assertDictContainsSubset(
|
self.assertDictContainsSubset(
|
||||||
{
|
{
|
||||||
"app_title": config.app_title,
|
"app_title": config.app_title,
|
||||||
|
"app_logo": config.app_logo,
|
||||||
},
|
},
|
||||||
response.data["settings"],
|
response.data["settings"],
|
||||||
)
|
)
|
||||||
|
@ -36,6 +36,7 @@ class TestApiUiSettings(DirectoriesMixin, APITestCase):
|
|||||||
response.data["settings"],
|
response.data["settings"],
|
||||||
{
|
{
|
||||||
"app_title": None,
|
"app_title": None,
|
||||||
|
"app_logo": None,
|
||||||
"update_checking": {
|
"update_checking": {
|
||||||
"backend_setting": "default",
|
"backend_setting": "default",
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user