Testing templates #4

Closed
opened 2011-05-06 13:09:41 +00:00 by heynemann · 2 comments
heynemann commented 2011-05-06 13:09:41 +00:00 (Migrated from github.com)

I want to be able to test my templates like:

class TemplateVows(Vows.Context):

    class IndexTemplate(Vows.Context):

        def topic(self):
            return self.template('/home/index.html', {
                'some': 'thing'
            })

        def should_have_container_div(self, topic):
            expect(topic).to_contain('div.container')

        class Paragraph(Vows.Context):
            def topic(self, template):
                return self.get_text(template, 'p.my-text')

            def should_have_paragraph_with_text(self, topic):
                expect(topic).to_be_like('some text')
I want to be able to test my templates like: ``` class TemplateVows(Vows.Context): class IndexTemplate(Vows.Context): def topic(self): return self.template('/home/index.html', { 'some': 'thing' }) def should_have_container_div(self, topic): expect(topic).to_contain('div.container') class Paragraph(Vows.Context): def topic(self, template): return self.get_text(template, 'p.my-text') def should_have_paragraph_with_text(self, topic): expect(topic).to_be_like('some text') ```
heynemann commented 2011-05-06 13:09:58 +00:00 (Migrated from github.com)

The css3 selectors can be easily done with lxml.

The css3 selectors can be easily done with lxml.
rafaelcaricio commented 2011-05-10 03:46:58 +00:00 (Migrated from github.com)

Full accepted. :)

Full accepted. :)
This repo is archived. You cannot comment on issues.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: archive/django-pyvows#4
No description provided.