An app to support your javascript tests stubing your django templates.
On javascript tests, unless creating html fixtures representing your django templates, you can obtain these fixtures requesting by ajax. It avoids code duplication and fake green tests, integrating your javascript tests with the templates that it works with.
/templatestub/ ?t=my_template.html &tt=one_template_tag &tt=other_template_tag:<span>template_tag_result</span> &f=a_filter:filter_result &f=other_filter &c={“person”:{“name”:“Tiago”},“country”:{“nome”:“Brasil”}}
Parameter that cannot be repeated: t - Template path, relative to one of TEMPLATE_DIRS c - Json representing the objects in template context Parameter that can be repeated: tt - Template tag that you want to replace in the follow format tag_name:tag_return f - Filter that you want to replate in the follow format filter_name:filter_return The tag_return ans filter_return aren’t required
Put the templatestub folder in your project and add this line to your urls.py:
(r’^‘, include(’templatestub.urls’)),
@hltbra for the original idea
@igorsobreira for helping with python and django
@everton_carpes for helping with ideas on how to do