@pytest.mark.django_db
def test_add_store_fs_by_path(po_directory, english):
 project = ProjectDBFactory(source_language=english)
 language = LanguageDBFactory()
 tp = TranslationProjectFactory(project=project, language=language)
 store = StoreDBFactory(translation_project=tp, parent=tp.directory, name='example_store.po')
 conf = config.get(tp.project.__class__, instance=tp.project)
 conf.set_config('pootle_fs.fs_type', 'localfs')
 conf.set_config('pootle_fs.fs_url', 'foo')
 fs_path = '/some/fs/example_store.po'
 pootle_path = store.pootle_path
 store_fs = StoreFS.objects.create(pootle_path=pootle_path, path=fs_path)
 assert (store_fs.project == project)
 assert (store_fs.store == store)
 assert (store_fs.pootle_path == pootle_path)
 assert (store_fs.path == fs_path)
 assert (store_fs.last_sync_hash is None)
 assert (store_fs.last_sync_mtime is None)
 assert (store_fs.last_sync_revision is None)

@ pytest . mark . django_db def test_add_store_fs_by_path ( po_directory , english ) : project = ProjectDBFactory ( source_language = english ) language = LanguageDBFactory ( ) tp = TranslationProjectFactory ( project = project , language = language ) store = StoreDBFactory ( translation_project = tp , parent = tp . directory , name = 'example_store.po' ) conf = config . get ( tp . project . __class__ , instance = tp . project ) conf . set_config ( 'pootle_fs.fs_type' , 'localfs' ) conf . set_config ( 'pootle_fs.fs_url' , 'foo' ) fs_path = '/some/fs/example_store.po' pootle_path = store . pootle_path store_fs = StoreFS . objects . create ( pootle_path = pootle_path , path = fs_path ) assert ( store_fs . project == project ) assert ( store_fs . store == store ) assert ( store_fs . pootle_path == pootle_path ) assert ( store_fs . path == fs_path ) assert ( store_fs . last_sync_hash is None ) assert ( store_fs . last_sync_mtime is None ) assert ( store_fs . last_sync_revision is None )
add a store_fs for pootle_path .