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')} }
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')} })
def link(): return Link( url='/', trans='action', fields=[required('required'), 'optional'] )