Skip to content

About

Test Django HTML with Context Managers

Resources

Stars

20 stars

Watchers

2 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

django-with-asserts - Test HTML with Context Managers

https://api.travis-ci.org/johnpaulett/django-with-asserts.png

Make your Django HTML tests more explicit and concise.

Turn this:

self.assertContains(
    resp,
    '<input id="id_email" type="text" name="email" maxlength="75" value="bob@example.com>',
    html=True
)

Into this:

with self.assertHTML(resp, 'input[name="email"]') as (elem,):
    self.assertEqual(elem.value, 'bob@example.com')

Links

About

Test Django HTML with Context Managers

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages