@pytest.mark.django_db
def test_format_registry_instance(no_formats):
 registry = FormatRegistry()
 _test_formats(registry, [])
 filetype = registry.register('foo', 'foo')
 assert isinstance(filetype, Format)
 assert (filetype.name == 'foo')
 assert (filetype.title == 'Foo')
 assert (str(filetype.extension) == 'foo')
 _test_formats(registry, ['foo'])

@ pytest . mark . django_db def test_format_registry_instance ( no_formats ) : registry = FormatRegistry ( ) _test_formats ( registry , [ ] ) filetype = registry . register ( 'foo' , 'foo' ) assert isinstance ( filetype , Format ) assert ( filetype . name == 'foo' ) assert ( filetype . title == 'Foo' ) assert ( str ( filetype . extension ) == 'foo' ) _test_formats ( registry , [ 'foo' ] )
tests the creation of a file extension .