Пример #1
0
def test_document_equality(doc):
    assert doc == {
        'integer': 123,
        'dict': {'key': 'value'},
        'list': [1, 2, 3],
        'link': Link(
            url='/',
            trans='action',
            fields=['optional', required('required')]
        ),
        'nested': {'child': Link(url='/123')}
    }
Пример #2
0
def doc():
    return Document(
        url='http://example.org',
        title='Example',
        content={
            'integer': 123,
            'dict': {'key': 'value'},
            'list': [1, 2, 3],
            'link': Link(
                url='/',
                trans='action',
                fields=['optional', required('required')]
            ),
            'nested': {'child': Link(url='/123')}
        })
Пример #3
0
def link():
    return Link(
        url='/',
        trans='action',
        fields=[required('required'), 'optional']
    )