@pytest.mark.django_db
def test_format_instance():
 ext = FileExtension.objects.create(name='foo')
 filetype = Format.objects.create(extension=ext, template_extension=ext)
 assert (str(filetype.template_extension) == str(ext))
 assert (str(filetype) == ('%s (%s/%s)' % (filetype.title, ext, ext)))

@ pytest . mark . django_db def test_format_instance ( ) : ext = FileExtension . objects . create ( name = 'foo' ) filetype = Format . objects . create ( extension = ext , template_extension = ext ) assert ( str ( filetype . template_extension ) == str ( ext ) ) assert ( str ( filetype ) == ( '%s (%s/%s)' % ( filetype . title , ext , ext ) ) )
tests the creation of a file extension .