From c09cc0781c8692318d35e4159d8b135fe4dde4c7 Mon Sep 17 00:00:00 2001 From: Embrace Date: Mon, 15 Apr 2019 16:52:07 -0300 Subject: [PATCH] Refactoring the test --- tests/test_template.py | 20 +++++++++++++------- tests/test_template_tag.py | 24 +++++++++++++++++++----- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/tests/test_template.py b/tests/test_template.py index a4d19f3..f885c83 100644 --- a/tests/test_template.py +++ b/tests/test_template.py @@ -1,10 +1,12 @@ -from django.test import TestCase -from django.template import Context, Template +from django.test import TestCase, RequestFactory +from django.template import Template, RequestContext class TemplateTagTest(TestCase): def setUp(self): - context = Context({}) + self.factory = RequestFactory() + request = self.factory.get('/teste') + context = RequestContext(request=request) template_to_render = Template( '{% load flags %}' '{% languages %}' @@ -15,8 +17,8 @@ def test_has_tags(self): """Must contains the tags in HTML""" tags = ( '