def _add_template_stores(self, tp, n=(3, 2), parent=None): from pytest_pootle.factories import StoreDBFactory, UnitDBFactory for i_ in range(0, n[0]): # add 3 stores store = StoreDBFactory(translation_project=tp) store.filetype = tp.project.filetype_tool.choose_filetype(store.name) store.save() # add 8 units to each store for i_ in range(0, 4): UnitDBFactory(store=store, target="")
def _add_template_stores(self, tp, n=(3, 2), parent=None): from pytest_pootle.factories import StoreDBFactory, UnitDBFactory for i_ in range(0, n[0]): # add 3 stores store = StoreDBFactory(translation_project=tp) store.filetype = tp.project.filetype_tool.choose_filetype( store.name) store.save() # add 8 units to each store for i_ in range(0, 4): UnitDBFactory(store=store, target="")
def _add_stores(self, tp, n=(3, 2), parent=None): from pytest_pootle.factories import StoreDBFactory, UnitDBFactory from pootle_store.constants import UNTRANSLATED, TRANSLATED, FUZZY, OBSOLETE for i_ in range(0, n[0]): # add 3 stores if parent is None: store = StoreDBFactory(translation_project=tp) else: store = StoreDBFactory(translation_project=tp, parent=parent) store.filetype = tp.project.filetype_tool.choose_filetype(store.name) store.save() # add 8 units to each store for state in [UNTRANSLATED, TRANSLATED, FUZZY, OBSOLETE]: for i_ in range(0, n[1]): UnitDBFactory(store=store, state=state)
def _add_stores(self, tp, n=(3, 2), parent=None): from pytest_pootle.factories import StoreDBFactory, UnitDBFactory from pootle_store.constants import UNTRANSLATED, TRANSLATED, FUZZY, OBSOLETE for i_ in range(0, n[0]): # add 3 stores if parent is None: store = StoreDBFactory(translation_project=tp) else: store = StoreDBFactory(translation_project=tp, parent=parent) store.filetype = tp.project.filetype_tool.choose_filetype( store.name) store.save() # add 8 units to each store for state in [UNTRANSLATED, TRANSLATED, FUZZY, OBSOLETE]: for i_ in range(0, n[1]): UnitDBFactory(store=store, state=state)