Test coverage report: markupmirror.views

# markupmirror.views: 14 total statements, 0.0% covered

Generated: Wed 2012-04-11 05:19 CDT

Source file: /home/buechler/Sites/django-markupmirror/markupmirror/views.py

Stats: 0 executed, 8 missed, 6 excluded, 9 ignored

1. `from django.contrib.auth.decorators import login_required`
2. `from django.contrib.auth.decorators import user_passes_test`
3. `from django.http import HttpResponse`
4. `from django.utils.decorators import method_decorator`
5. `from django.views.generic.base import View`
6. ``
7. `from markupmirror.markup.base import markup_pool`
8. ``
9. ``
10. `class MarkupPreview(View):`
11. `"""Renders markup content to HTML for preview purposes."""`
12. ``
13. `http_method_names = ['post']`
14. ``
15. `@method_decorator(login_required)`
16. `@method_decorator(user_passes_test(lambda user: user.is_staff))`
17. `def post(self, request, markup_type, *args, **kwargs):`
18. `markup = markup_pool.get_markup(markup_type)`
19. `text = self.request.POST.get('text', u"")`
20. `return HttpResponse(markup(text), content_type='text/html')`
21. ``
22. ``
23. `__all__ = ('MarkupMirrorPreview',)`