Example #1
0
    def setUp(self):
        app.config['TESTING'] = True
        db.drop_all()
        db.create_all()
        self.client = app.test_client()

        #add basic data to database
        new_drug = drug(DRUGid='e28b7d9c-e817-47c1-b227-97d8eca021a7',\
                        code='2062', name='杏仁', unit='克', alias=' ',\
                        py='xr', wb='sw', isClassical='1', SPETid=' ',\
                        illustration='', createDay='2008-03-25 01=42=59.000',\
                        optrid='c6543358-354b-4986-a06f-bd61b0cde15d', state='3')
        db.session.add(new_drug)

        new_fixedrecipe = fixedrecipe(FREPid='65dd5753-aad0-4261-94d3-09a67bd4f9a1',\
                        code='378', name='华盖散', effect='', py='HGS', wb='WUA', isClassical='1',\
                        SPETid=' ', illustration='', createDay='2008-03-25 02:05:10.000',\
                        optrid='c6543358-354b-4986-a06f-bd61b0cde15d', state='3')
        db.session.add(new_fixedrecipe)

        new_fixedrecipeItem = fixedrecipeItem(FRITid='9c18a29f-faa1-494d-839c-7a89cba439e8',\
                            DRUGid='e28b7d9c-e817-47c1-b227-97d8eca021a7',\
                            FREPid='65dd5753-aad0-4261-94d3-09a67bd4f9a1',\
                            quality='9.0000', sequence='0', illustration='')
        db.session.add(new_fixedrecipeItem)

        db.session.commit()
Example #2
0
 def setUp(self):
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(
         basedir, TEST_DB)
     self.app = app.test_client()
     db.create_all()
Example #3
0
 def setUp(self):
     app.config["TESTING"] = True
     app.config["WTF_CSRF_ENABLED"] = False
     app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + \
         os.path.join(basedir, TEST_DB)
     self.app = app.test_client()
     db.create_all()
Example #4
0
 def setUp(self):
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
         os.path.join(BASE_DIR, TEST_DB)
     self.app = app.test_client()  # mocks out the entire Flask app
     db.create_all()
Example #5
0
    def setUp(self):
        self.client = app.test_client()
        app.config['TESTING'] = True

        with self.client as c:
            with c.session_transaction() as session:
                session['user'] = '******'
Example #6
0
 def setUp(self):
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
         os.path.join(basedir, TEST_DB)
     self.app = app.test_client()
     db.create_all()
Example #7
0
    def setUp(self):
        app.config['TESTING'] = True
        app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
            os.path.join(basedir, TEST_DIR)
        self.app = app.test_client()
        db.create_all()

        self.michaelUser = ('Michael', '*****@*****.**', 'python', 'python')
Example #8
0
 def setUp(self):
     # Reset the values in original config app
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'+ os.path.join(basedir, DATABASE_NAME)
     app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
     # Mock the app Object to provide fake attributes/methods.
     self.app = app.test_client()
     db.create_all()
Example #9
0
    def setUp(self):
        """Set up."""
        app.config['TESTING'] = True
        app.config['WTF_CSRF_ENABLED'] = False
        app.config['DEBUG'] = False
        app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
            os.path.join(basedir, TEST_DB)
        self.app = app.test_client()
        db.create_all()

        self.assertEquals(app.debug, False)
 def setUp(self):
     """
         Executing prior to each tasks.
         Create environnement where tests while be executing.
     """
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
                                             os.path.join(basedir, TEST_DB)
     self.app = app.test_client()
     db.create_all()
Example #11
0
 def setUp(self):
     self.client = app.test_client()
     self.client.testing = True
Example #12
0
def client():
    return app.test_client()
Example #13
0
 def setUp(self):
     app.config['TESTING'] = True
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///../tests/test.db'
     self.app = app.test_client()
Example #14
0
 def setup(self):
     self.app = app.test_client()
Example #15
0
 def setUp(self):
     app.testing = True
     self.app = app.test_client()
 def setUp(self):
     self.app = app.test_client()
Example #17
0
 def setUp(self):
     app.config['TESTING'] = True
     db.drop_all()
     db.create_all()
     self.client = app.test_client()
Example #18
0
def client():
    app.config["TESTING"] = True
    app.config["SQLALCHEMY_DATABASE_URI"] = "postgresql://localhost:5432/paperbuzz_test"
    return app.test_client()
Example #19
0
 def setUp(self):
     self.client = app.test_client()
     app.config['TESTING'] = True
Example #20
0
 def setUp(self):
     self.client = app.test_client()
     app.config['TESTING'] = True
     connect_to_db(app, "postgresql:///testdb")
     db.create_all()
     test_data()
Example #21
0
 def setUp(self):
     app.testing = True
     self.app = app.test_client()
     copyfile(str(TEMPLATE_PATH), str(TEMPLATE_BACKUP_PATH))
Example #22
0
 def tearDown(self):
     self.app = app.test_client()
Example #23
0
 def setUp(self):
     self.app = app.test_client()
     self.maxDiff = None