コード例 #1
0
ファイル: api.py プロジェクト: sarkis89/stoq
    def prepare_test(self):
        """Prepares to run a standalone test.
        This initializes Stoq and creates a store and returns
        an example creator.

        :returns: an :py:class:`~stoqlib.domain.exampledata.ExampleCreator`
        """
        # FIXME: We need to move this into stoqlib
        from stoq.gui.shell.bootstrap import boot_shell
        from stoq.lib.options import get_option_parser
        parser = get_option_parser()
        options = parser.parse_args(sys.argv[1:])[0]
        options.wizard = False
        options.splashscreen = False
        options.autoreload = False
        options.login_username = u'admin'
        options.non_fatal_warnings = False
        shell = boot_shell(options, initial=False)
        shell._dbconn.connect()
        shell._do_login()

        from stoqlib.domain.exampledata import ExampleCreator
        ec = ExampleCreator()
        store = self.new_store()
        ec.set_store(store)
        return ec
コード例 #2
0
ファイル: api.py プロジェクト: adrianoaguiar/stoq
    def prepare_test(self):
        """Prepares to run a standalone test.
        This initializes Stoq and creates a store and returns
        an example creator.

        :returns: an :py:class:`~stoqlib.domain.exampledata.ExampleCreator`
        """
        # FIXME: We need to move this into stoqlib
        from stoq.gui.shell.bootstrap import boot_shell
        from stoq.lib.options import get_option_parser
        parser = get_option_parser()
        options = parser.parse_args(sys.argv[1:])[0]
        options.wizard = False
        options.splashscreen = False
        options.autoreload = False
        options.login_username = u'admin'
        options.non_fatal_warnings = False
        shell = boot_shell(options, initial=False)
        shell._dbconn.connect()
        shell._do_login()

        from stoqlib.domain.exampledata import ExampleCreator
        ec = ExampleCreator()
        store = self.new_store()
        ec.set_store(store)
        return ec
コード例 #3
0
def example_creator(store, current_station, current_user, current_branch):
    creator = ExampleCreator()
    creator.set_store(store)
    creator.current_station = current_station
    creator.current_user = current_user
    creator.current_branch = current_branch
    return creator
コード例 #4
0
 def __init__(self, test):
     unittest.TestCase.__init__(self, test)
     ExampleCreator.__init__(self)
コード例 #5
0
ファイル: domaintest.py プロジェクト: pkaislan/stoq
 def __init__(self, test):
     unittest.TestCase.__init__(self, test)
     ExampleCreator.__init__(self)
コード例 #6
0
 def _create_person_facet(self):
     return ExampleCreator.create(self.store, self.facet.__name__)
コード例 #7
0
ファイル: test_person.py プロジェクト: rosalin/stoq
 def _create_person_facet(self):
     return ExampleCreator.create(self.store, self.facet.__name__)