Included the default serviceworker, updated the manifest, Add the default offline page, updated the unit test, Redme
This commit is contained in:
@@ -33,4 +33,6 @@ DATABASES = {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': 'mydatabase',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
@@ -15,6 +15,7 @@ class AppSettingsTest(TestCase):
|
||||
'PWA_APP_DISPLAY',
|
||||
'PWA_APP_ORIENTATION',
|
||||
'PWA_APP_START_URL',
|
||||
'PWA_APP_FETCH_URL',
|
||||
'PWA_APP_ICONS',
|
||||
'PWA_APP_DIR',
|
||||
'PWA_APP_LANG'
|
||||
|
||||
@@ -14,7 +14,14 @@ class CreateMetaTemplateTagTest(TestCase):
|
||||
def test_has_tags(self):
|
||||
"""Must contains the tags in HTML"""
|
||||
tags = [
|
||||
'<link rel="apple-touch-icon" href="/" sizes="160x160">',
|
||||
'<link rel="apple-touch-icon" href="/images/icons/icon-72x72.png" sizes="72x72">',
|
||||
'<link rel="apple-touch-icon" href="/images/icons/icon-96x96.png" sizes="96x96">',
|
||||
'<link rel="apple-touch-icon" href="/images/icons/icon-128x128.png" sizes="128x128">',
|
||||
'<link rel="apple-touch-icon" href="/images/icons/icon-144x144.png" sizes="144x144">',
|
||||
'<link rel="apple-touch-icon" href="/images/icons/icon-152x152.png" sizes="152x152">',
|
||||
'<link rel="apple-touch-icon" href="/images/icons/icon-192x192.png" sizes="192x192">',
|
||||
'<link rel="apple-touch-icon" href="/images/icons/icon-384x384.png" sizes="384x384">',
|
||||
'<link rel="apple-touch-icon" href="/images/icons/icon-512x512.png" sizes="512x512">',
|
||||
'<link rel="manifest" href="/manifest.json">',
|
||||
'<meta name="theme-color" content="#000">',
|
||||
'<meta name="apple-mobile-web-app-capable" content="yes">',
|
||||
|
||||
@@ -41,3 +41,13 @@ class ManifestTest(TestCase):
|
||||
for expected in contents:
|
||||
with self.subTest():
|
||||
self.assertContains(self.response, expected)
|
||||
|
||||
|
||||
class OfflineTest(TestCase):
|
||||
def setUp(self):
|
||||
self.response = self.client.get(r('offline'))
|
||||
|
||||
def test_get(self):
|
||||
"""GET /offline Should return status code 200"""
|
||||
self.assertEqual(200, self.response.status_code)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user