Commit fbdd10b0 authored by Craig Weber's avatar Craig Weber
Browse files

Remove usage of usage_count_enabled template tag since this tag was removed in Wagtail 4.1

parent 59b5cd63
...@@ -15,6 +15,5 @@ INSTALLED_APPS += [ ...@@ -15,6 +15,5 @@ INSTALLED_APPS += [
] ]
WAGTAILVIDEOS_VIDEO_MODEL = 'app.CustomVideoModel' WAGTAILVIDEOS_VIDEO_MODEL = 'app.CustomVideoModel'
WAGTAIL_USAGE_COUNT_ENABLED = True
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
...@@ -221,8 +221,7 @@ class TestVideoEditView(TestCase, WagtailTestUtils): ...@@ -221,8 +221,7 @@ class TestVideoEditView(TestCase, WagtailTestUtils):
# Ensure the form supports file uploads # Ensure the form supports file uploads
self.assertContains(response, 'enctype="multipart/form-data"') self.assertContains(response, 'enctype="multipart/form-data"')
@override_settings(WAGTAIL_USAGE_COUNT_ENABLED=True) def test_usage_count(self):
def test_with_usage_count(self):
response = self.get() response = self.get()
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'wagtailvideos/videos/edit.html') self.assertTemplateUsed(response, 'wagtailvideos/videos/edit.html')
......
...@@ -67,13 +67,10 @@ ...@@ -67,13 +67,10 @@
<dt>{% trans "Duration" %}</dt> <dt>{% trans "Duration" %}</dt>
<dd>{{ video.formatted_duration }}</dd> <dd>{{ video.formatted_duration }}</dd>
{% endif %} {% endif %}
{% usage_count_enabled as uc_enabled %} <dt>{% trans "Usage" %}</dt>
{% if uc_enabled %} <dd>
<dt>{% trans "Usage" %}</dt> <a href="{{ video.usage_url }}">{% blocktrans count usage_count=video.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}</a>
<dd> </dd>
<a href="{{ video.usage_url }}">{% blocktrans count usage_count=video.get_usage.count %}Used {{ usage_count }} time{% plural %}Used {{ usage_count }} times{% endblocktrans %}</a>
</dd>
{% endif %}
</dl> </dl>
</div> </div>
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment