@pytest.mark.django_db
def test_format_registry_template_extension(no_formats):
 registry = FormatRegistry()
 filetype = registry.register('foo', 'foo', template_extension='bar')
 assert (str(filetype.template_extension) == 'bar')
 _test_formats(registry, ['foo'])
 filetype2 = registry.register('special_foo', 'foo', template_extension='bar')
 assert (str(filetype.template_extension) == 'bar')
 assert (str(filetype2.template_extension) == 'bar')
 _test_formats(registry, ['foo', 'special_foo'])

@ pytest . mark . django_db def test_format_registry_template_extension ( no_formats ) : registry = FormatRegistry ( ) filetype = registry . register ( 'foo' , 'foo' , template_extension = 'bar' ) assert ( str ( filetype . template_extension ) == 'bar' ) _test_formats ( registry , [ 'foo' ] ) filetype2 = registry . register ( 'special_foo' , 'foo' , template_extension = 'bar' ) assert ( str ( filetype . template_extension ) == 'bar' ) assert ( str ( filetype2 . template_extension ) == 'bar' ) _test_formats ( registry , [ 'foo' , 'special_foo' ] )
tests the creation of a file extension .