mirror of
https://github.com/sissbruecker/linkding
synced 2025-02-17 04:48:22 +00:00
* Added Apple web-app meta tag #358 * Added manifest file for web app * Changed manifest to use template #358 * Small tweaks, add tests --------- Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@gmail.com>
33 lines
1,003 B
Python
33 lines
1,003 B
Python
from django.test import TestCase, override_settings
|
|
|
|
|
|
class MetadataViewTestCase(TestCase):
|
|
|
|
def test_default_manifest(self):
|
|
response = self.client.get("/manifest.json")
|
|
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
response_body = response.json()
|
|
expected_body = {
|
|
"short_name": "linkding",
|
|
"start_url": "bookmarks",
|
|
"display": "standalone",
|
|
"scope": "/"
|
|
}
|
|
self.assertDictEqual(response_body, expected_body)
|
|
|
|
@override_settings(LD_CONTEXT_PATH="linkding/")
|
|
def test_manifest_respects_context_path(self):
|
|
response = self.client.get("/manifest.json")
|
|
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
response_body = response.json()
|
|
expected_body = {
|
|
"short_name": "linkding",
|
|
"start_url": "bookmarks",
|
|
"display": "standalone",
|
|
"scope": "/linkding/"
|
|
}
|
|
self.assertDictEqual(response_body, expected_body)
|