コード例 #1
0
ファイル: test_base_domain.py プロジェクト: Guillon88/stoq
    def setUpClass(cls):
        DomainTest.setUpClass()
        RECREATE_SQL = """
        DROP TABLE IF EXISTS dung;
        DROP TABLE IF EXISTS dong;
        DROP TABLE IF EXISTS ding;

        CREATE TABLE ding (
            id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
            te_id bigint UNIQUE REFERENCES transaction_entry(id),
            int_field integer default 0,
            str_field text default ''
        );
        CREATE TABLE dong (
            id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
            te_id bigint UNIQUE REFERENCES transaction_entry(id),
            bool_field boolean default false,
            ding_id uuid REFERENCES ding(id) ON UPDATE CASCADE
        );
        CREATE TABLE dung (
            id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
            identifier SERIAL NOT NULL,
            te_id bigint UNIQUE REFERENCES transaction_entry(id),
            ding_id uuid REFERENCES ding(id) ON UPDATE CASCADE
        );
        """
        cls.store.execute(RECREATE_SQL)
        cls.store.commit()
コード例 #2
0
ファイル: test_base_domain.py プロジェクト: esosaja/stoq
    def setUpClass(cls):
        DomainTest.setUpClass()
        RECREATE_SQL = """
        DROP TABLE IF EXISTS dung;
        DROP TABLE IF EXISTS dong;
        DROP TABLE IF EXISTS ding;

        CREATE TABLE ding (
            id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
            te_id bigint UNIQUE REFERENCES transaction_entry(id),
            int_field integer default 0,
            str_field text default ''
        );
        CREATE TABLE dong (
            id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
            te_id bigint UNIQUE REFERENCES transaction_entry(id),
            bool_field boolean default false,
            ding_id uuid REFERENCES ding(id) ON UPDATE CASCADE
        );
        CREATE TABLE dung (
            id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
            identifier SERIAL NOT NULL,
            te_id bigint UNIQUE REFERENCES transaction_entry(id),
            ding_id uuid REFERENCES ding(id) ON UPDATE CASCADE
        );
        """
        cls.store.execute(RECREATE_SQL)
        cls.store.commit()
コード例 #3
0
 def tearDown(self):
     store = new_store()
     for person in store.find(Person, name=NAME):
         store.remove(person)
     store.commit()
     DomainTest.tearDown(self)
     store.close()
コード例 #4
0
ファイル: test_transaction.py プロジェクト: Guillon88/stoq
    def tearDown(self):
        # Make sure to remove all committed persons from the database
        with new_store() as store:
            test_names = [u'dummy transaction test', u'dummy', u'doe', u'john']
            store.find(Person, Person.name.is_in(test_names)).remove()

        DomainTest.tearDown(self)
コード例 #5
0
 def tearDown(self):
     store = new_store()
     for person in store.find(Person, name=NAME):
         store.remove(person)
     store.commit()
     DomainTest.tearDown(self)
     store.close()
コード例 #6
0
    def tearDown(self):
        # Make sure to remove all committed persons from the database
        with new_store() as store:
            test_names = [u'dummy transaction test', u'dummy', u'doe', u'john']
            store.find(Person, Person.name.is_in(test_names)).remove()

        DomainTest.tearDown(self)
コード例 #7
0
ファイル: test_sellable.py プロジェクト: rosalin/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self._base_category = SellableCategory(description=u"Cigarro",
                                            store=self.store)
     self._category = SellableCategory(description=u"Hollywood",
                                       category=self._base_category,
                                       suggested_markup=10,
                                       store=self.store)
コード例 #8
0
ファイル: test_sellable.py プロジェクト: LeonamSilva/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self._base_category = SellableCategory(description=u"Cigarro",
                                            store=self.store)
     self._category = SellableCategory(description=u"Hollywood",
                                       category=self._base_category,
                                       suggested_markup=10,
                                       store=self.store)
コード例 #9
0
ファイル: test_boleto.py プロジェクト: leandrorchaves/stoq
 def tearDown(self):
     DomainTest.tearDown(self)
     try:
         os.unlink(self._filename)
     except OSError:
         pass
     if self._pdf_html:
         try:
             os.unlink(self._pdf_html)
         except OSError:
             pass
コード例 #10
0
ファイル: test_boleto.py プロジェクト: Felipebros/stoq
 def tearDown(self):
     DomainTest.tearDown(self)
     try:
         os.unlink(self._filename)
     except OSError:
         pass
     if self._pdf_html:
         try:
             os.unlink(self._pdf_html)
         except OSError:
             pass
コード例 #11
0
    def setUp(self):
        from stoqlib.database.runtime import new_store
        self.store = new_store()
        self.fake.set_store(self.store)
        self.set_store(self.store)

        self._unhandled_exceptions = []
        self._old_hook = sys.excepthook
        sys.excepthook = self._except_hook
        test_system_notifier.reset()
        DomainTest.setUp(self)
コード例 #12
0
ファイル: uitestutils.py プロジェクト: rosalin/stoq
    def tearDown(self):
        sys.excepthook = self._old_hook
        DomainTest.tearDown(self)

        messages = test_system_notifier.reset()
        if messages:
            self.fail("Unhandled messages: %r, use @mock.patch()" % (
                messages, ))

        if self._unhandled_exceptions:
            self.fail("Unhandled exceptions: %r" % (
                self._unhandled_exceptions))
コード例 #13
0
    def tearDown(self):
        sys.excepthook = self._old_hook
        DomainTest.tearDown(self)

        messages = test_system_notifier.reset()
        if messages:
            self.fail("Unhandled messages: %r, use @mock.patch()" % (
                messages, ))

        if self._unhandled_exceptions:
            self.fail("Unhandled exceptions: %r" % (
                self._unhandled_exceptions))
コード例 #14
0
    def setUpClass(cls):
        DomainTest.setUpClass()
        RECREATE_SQL = """
        DROP TABLE IF EXISTS xml_table;

        CREATE TABLE xml_table (
            id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
            te_id bigint UNIQUE REFERENCES transaction_entry(id),
            data xml
        );
        """
        cls.store.execute(RECREATE_SQL)
        cls.store.commit()
コード例 #15
0
ファイル: test_base_domain.py プロジェクト: LeonamSilva/stoq
 def setUpClass(cls):
     DomainTest.setUpClass()
     RECREATE_SQL = """
     DROP TABLE IF EXISTS ding;
     CREATE TABLE ding (
         id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
         te_id bigint UNIQUE REFERENCES transaction_entry(id),
         int_field integer default 0,
         str_field text default ''
     );
     """
     cls.store.execute(RECREATE_SQL)
     cls.store.commit()
コード例 #16
0
ファイル: test_properties.py プロジェクト: sarkis89/stoq
    def setUpClass(cls):
        DomainTest.setUpClass()
        RECREATE_SQL = """
        DROP TABLE IF EXISTS xml_table;

        CREATE TABLE xml_table (
            id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
            te_id bigint UNIQUE REFERENCES transaction_entry(id),
            data xml
        );
        """
        cls.store.execute(RECREATE_SQL)
        cls.store.commit()
コード例 #17
0
    def setUpClass(cls):
        DomainTest.setUpClass()
        RECREATE_SQL = """
        DROP TABLE IF EXISTS test_table;

        CREATE TABLE test_table (
            id uuid PRIMARY KEY DEFAULT uuid_generate_v1(),
            te_id bigint UNIQUE REFERENCES transaction_entry(id),
            is_high BOOLEAN DEFAULT NULL,
            power_level INTEGER DEFAULT NULL
        );
        """
        cls.store.execute(RECREATE_SQL)
        cls.store.commit()
コード例 #18
0
 def setUpClass(cls):
     DomainTest.setUpClass()
     cls._ui = NFeUI()
コード例 #19
0
 def setUp(self):
     DomainTest.setUp(self)
     self.branch = self.create_branch()
コード例 #20
0
ファイル: test_product.py プロジェクト: tmaxter/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self.branch = get_current_branch(self.store)
コード例 #21
0
 def setUp(self):
     DomainTest.setUp(self)
     self.sparam = sysparam
コード例 #22
0
 def setUp(self):
     self._unhandled_exceptions = []
     self._old_hook = sys.excepthook
     sys.excepthook = self._except_hook
     test_system_notifier.reset()
     DomainTest.setUp(self)
コード例 #23
0
ファイル: test_product.py プロジェクト: tmaxter/stoq
 def setUp(self):
     DomainTest.setUp(self)
     sellable = self.create_sellable()
     self.product = Product(sellable=sellable, store=self.store)
コード例 #24
0
ファイル: test_boleto.py プロジェクト: leandrorchaves/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self._filename = tempfile.mktemp(prefix="stoqlib-test-boleto-",
                                      suffix=".pdf")
     self._pdf_html = None
コード例 #25
0
ファイル: test_boleto.py プロジェクト: Felipebros/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self._filename = tempfile.mktemp(prefix="stoqlib-test-boleto-",
                                      suffix=".pdf")
     self._pdf_html = None
コード例 #26
0
ファイル: test_product.py プロジェクト: romaia/stoq
 def setUp(self):
     DomainTest.setUp(self)
     sellable = self.create_sellable()
     self.product = Product(sellable=sellable,
                            store=self.store)
コード例 #27
0
ファイル: test_parameters.py プロジェクト: Guillon88/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self.sparam = sysparam
コード例 #28
0
ファイル: test_product.py プロジェクト: romaia/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self.branch = get_current_branch(self.store)
コード例 #29
0
ファイル: test_queryexecuter.py プロジェクト: rosalin/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self.qe = QueryExecuter(self.store)
     self.qe.set_search_spec(ClientCategory)
     self.sfilter = mock.Mock()
     self.qe.set_filter_columns(self.sfilter, ['name'])
コード例 #30
0
ファイル: test_nfe.py プロジェクト: adrianoaguiar/stoq
 def setUpClass(cls):
     DomainTest.setUpClass()
     cls._ui = NFeUI()
コード例 #31
0
ファイル: uitestutils.py プロジェクト: rosalin/stoq
 def setUp(self):
     self._unhandled_exceptions = []
     self._old_hook = sys.excepthook
     sys.excepthook = self._except_hook
     test_system_notifier.reset()
     DomainTest.setUp(self)
コード例 #32
0
ファイル: test_sellable.py プロジェクト: rosalin/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self._base_category = self._create_category(u'Monitor')
コード例 #33
0
ファイル: test_sellable.py プロジェクト: LeonamSilva/stoq
 def setUp(self):
     DomainTest.setUp(self)
     self._base_category = self._create_category(u'Monitor')
コード例 #34
0
 def setUp(self):
     DomainTest.setUp(self)
     self.branch = self.create_branch()