File: test_fixtures_templates.py

package info (click to toggle)
python-pytest-djangoapp 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 396 kB
  • sloc: python: 1,116; makefile: 114; sh: 6
file content (20 lines) | stat: -rw-r--r-- 678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

def test_template_context(template_context, user_create):
    assert template_context({'somevar': 'someval'})

    context = template_context({'a': 'b'}, user='aname')
    assert context.get('user').username == 'aname'

    auser = user_create(attributes={'username': 'xx'})
    context = template_context({'a': 'b'}, user=auser)
    assert context.get('user').username == 'xx'


def test_template_render_tag(template_render_tag):
    rendered = template_render_tag('static', 'static "some.jpg"')
    assert rendered == '/static/some.jpg'


def test_this_template_strip_tags(template_strip_tags):
    stripped = template_strip_tags('<b>some</b>')
    assert stripped == 'some'