0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Don't use explorer-menu.js to test for menu JS being pulled in

because we're about to ditch it
This commit is contained in:
Matt Westcott 2017-02-17 16:57:49 +00:00
parent 41c8bfced9
commit 761b19be96
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,7 @@
from __future__ import absolute_import, unicode_literals
from django import forms
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.http import HttpResponse
from wagtail.wagtailadmin.menu import MenuItem
@ -42,6 +44,10 @@ hooks.register('before_serve_page', block_googlebot)
class KittensMenuItem(MenuItem):
@property
def media(self):
return forms.Media(js=[static('testapp/js/kittens.js')])
def is_shown(self, request):
return not request.GET.get('hide-kittens', False)

View File

@ -35,7 +35,7 @@ class TestHome(TestCase, WagtailTestUtils):
# check that media attached to menu items is correctly pulled in
self.assertContains(
response,
'<script type="text/javascript" src="/static/wagtailadmin/js/explorer-menu.js"></script>'
'<script type="text/javascript" src="/static/testapp/js/kittens.js"></script>'
)
# check that custom menu items (including classname / attrs parameters) are pulled in
self.assertContains(