from __future__ import absolute_import, unicode_literals from django.conf.urls import url from wagtailtrans.views.translation import TranslationView app_name = 'wagtailtrans' urlpatterns = [ url(r'^(?P<instance_id>\d+)/add/(?P<language_code>[^/]+)/$', TranslationView.as_view(), name='add'), ]
def test_post_404(self, rf): """It should raise a 404 when a wrong page_pk is given.""" view = TranslationView.as_view() with pytest.raises(Http404): view(rf.post('/'), instance_id=0, language_code='en')