Skip to content

Commit

Permalink
Test: django_staticfiles_json
Browse files Browse the repository at this point in the history
  • Loading branch information
hartwork committed Nov 1, 2023
1 parent da606af commit d55dbcd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,13 @@ mailman
Check for mailman and output version.


django_staticfiles_json
-----------------------

Checks for the presence of a Django assets manifest file
[`staticfiles.json`](https://docs.djangoproject.com/en/4.2/ref/contrib/staticfiles/).


composer
--------

Expand Down
13 changes: 13 additions & 0 deletions snallygaster
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,19 @@ def test_mailman(url):
pout("mailman", f"{murl} {ver}")


@INFO
def test_django_staticfiles_json(url):
furl = url + '/static/staticfiles.json'
data = fetcher(furl)
try:
parsed = json.loads(data)
except json.JSONDecodeError:
pass
else:
if isinstance(parsed, dict) and 'paths' in parsed:
pout('django_staticfiles_json', furl)


@INFO
def test_composer(url):
for c in ['composer.json', 'composer.lock']:
Expand Down

0 comments on commit d55dbcd

Please sign in to comment.