@pytest.mark.django_db
def test_file_extension_bad():
 FileExtension.objects.create(name='foo')
 with pytest.raises(IntegrityError):
  FileExtension.objects.create(name='foo')

@ pytest . mark . django_db def test_file_extension_bad ( ) : FileExtension . objects . create ( name = 'foo' ) with pytest . raises ( IntegrityError ) : FileExtension . objects . create ( name = 'foo' )
test that you cant add a duplicate file extension .