More tests. No more warning from lxml.

This commit is contained in:
Rafael Carício 2011-05-10 06:19:02 -03:00
parent aaa8f110fd
commit e12582a02c
3 changed files with 18 additions and 1 deletions

View file

@ -27,7 +27,7 @@ class Template(object):
self.doc = None
def load(self):
if not self.doc:
if self.doc is None:
self.doc = fromstring(render_to_string(self.template_name, self.context))
return self.doc

View file

@ -8,4 +8,18 @@
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 Rafael Caricio rafael@caricio.com
from pyvows import Vows, expect
from django_pyvows.context import DjangoContext, DjangoSubContext
import django_pyvows.assertions
from sandbox.main.views import home
@Vows.batch
class DefaultsVows(DjangoContext):
def topic(self):
return self._get_settings()
def should_be_using_the_default_settings(self, topic):
expect(topic).to_equal('settings')

View file

@ -31,6 +31,9 @@ class TemplateVows(DjangoContext):
def should_not_have_a_hello_div(self, topic):
expect(topic).Not.to_contain('div.hello')
def should_be_index_file(self, topic):
expect(unicode(topic)).to_equal('index.html')
class Paragraph(DjangoSubContext):
def topic(self, template):