@pytest.mark.django_db
def test_add_store_bad_path(po_directory, english):
 fs_path = '/some/fs/example.po'
 project = ProjectDBFactory(source_language=english)
 language = LanguageDBFactory()
 tp = TranslationProjectFactory(project=project, language=language)
 conf = config.get(project.__class__, instance=project)
 conf.set_config('pootle_fs.fs_type', 'localfs')
 conf.set_config('pootle_fs.fs_url', 'foo')
 store = StoreDBFactory(translation_project=tp, parent=tp.directory, name='example_store.po')
 with pytest.raises(ValidationError):
  StoreFS.objects.create(store=store, pootle_path='/some/other/path.po', path=fs_path)

@ pytest . mark . django_db def test_add_store_bad_path ( po_directory , english ) : fs_path = '/some/fs/example.po' project = ProjectDBFactory ( source_language = english ) language = LanguageDBFactory ( ) tp = TranslationProjectFactory ( project = project , language = language ) conf = config . get ( project . __class__ , instance = project ) conf . set_config ( 'pootle_fs.fs_type' , 'localfs' ) conf . set_config ( 'pootle_fs.fs_url' , 'foo' ) store = StoreDBFactory ( translation_project = tp , parent = tp . directory , name = 'example_store.po' ) with pytest . raises ( ValidationError ) : StoreFS . objects . create ( store = store , pootle_path = '/some/other/path.po' , path = fs_path )
try to create a store_fs where pootle_path and store .