Closed mathemaat closed 6 years ago
@mathemaat The unit tests fail (see https://travis-ci.org/jonge-democraten/website/builds/313962101) because request.META.HTTP_HOST is None during unit tests, which somehow causes the whole menu to disappear (not sure why).
request.META.HTTP_HOST
This can be fixed by checking for existence of HTTP_HOST:
HTTP_HOST
{% if request.META.HTTP_HOST and request.META.HTTP_HOST|contains:"friesland" %}
Note that you don't need a templatetag for a 'contains', you can simply do:
{% if "friesland" in request.META.HTTP_HOST %}
This also does not cause errors if HTTP_HOST is None :)
Good templatetag exercise anyway ;)
Ik dacht deze al afgerond was, maar inderdaad, de Travis build was niet gelukt.
Inmiddels staat er een nieuwe versie klaar.
:+1:
@mathemaat The unit tests fail (see https://travis-ci.org/jonge-democraten/website/builds/313962101) because
request.META.HTTP_HOST
is None during unit tests, which somehow causes the whole menu to disappear (not sure why).This can be fixed by checking for existence of
HTTP_HOST
:Note that you don't need a templatetag for a 'contains', you can simply do:
This also does not cause errors if
HTTP_HOST
is None :)Good templatetag exercise anyway ;)