Ejemplo n.º 1
0
 def tearDown(self):
     """ Test teardown """
     # Remove the tables and their data from the database
     self.process.terminate()
     session.close()
     Base.metadata.drop_all(engine)
     self.browser.quit()
Ejemplo n.º 2
0
 def tearDown(self):
     """ Test Teardown """
     self.process.terminate()
     session.close()
     engine.dispose()
     Base.metadata.drop_all(engine)
     self.browser.quit()
Ejemplo n.º 3
0
 def tearDown(self):
     """ Test teardown """
     # remove the tables and their data from the database
     self.process.terminate()
     session.close()
     Base.metadata.drop_all(engine)
     self.browser.quit()
Ejemplo n.º 4
0
    def setUp(self):
        """ Test setup """
        self.browser = Browser("phantomjs")

        # Set up the tables in the database
        Base.metadata.create_all(engine)

        # Create an example user
        self.user = User(name="Alice",
                         email="*****@*****.**",
                         password=generate_password_hash("test"))
        session.add(self.user)
        #        session.commit()
        try:
            session.commit()
        except:
            session.rollback()
            raise
        finally:
            session.close()  # optional, depends on use case

        self.process = multiprocessing.Process(target=app.run,
                                               kwargs={"port": 8080})
        self.process.start()
        time.sleep(2)
Ejemplo n.º 5
0
 def tearDown(self):
   """
   Test teardown
   """
   session.close()
   # Remove the tables and their data from the database
   Base.metadata.drop_all(engine)
Ejemplo n.º 6
0
 def tearDown(self):
     """ Test teardown """
     self.process.terminate()
     session.close()
     engine.dispose()
     Base.metadata.drop_all(engine)
     self.browser.quit()
Ejemplo n.º 7
0
 def tearDown(self):
     """
     Teardown
     TODO: This drops the table after use, how to validate everything that happens
     with table before dropping?
     """
     session.close()
     Base.metadata.drop_all(engine)
Ejemplo n.º 8
0
 def tearDown(self):
     """Test Teardown"""
     #Remove the tables and their data
     self.process.terminate()
     session.close()
     engine.dispose()
     Base.metadata.drop_all(engine)
     self.browser.quit()
Ejemplo n.º 9
0
 def tearDown(self):
     """ Test teardown """
     session.close()
     # Remove the tables and their data from the database
     Base.metadata.drop_all(engine)
     def simulate_login(self):
     	with self.client.session_transaction() as http_session:
     		http_session["user_id"] = str(self.user.id)
     		http_session["_fresh"] = True
Ejemplo n.º 10
0
    def tearDown(self):
        """ Test teardown """
        session.close()
        # Remove the tables and their data from the database
        Base.metadata.drop_all(engine)

        def simulate_login(self):
            with self.client.session_transaction() as http_session:
                http_session["user_id"] = str(self.user.id)
                http_session["_fresh"] = True
Ejemplo n.º 11
0
 def tearDown(self):
     ''' Test teardown '''
     # remove the tables and their data from the database
     self.process.terminate()
     session.close()
     engine.dispose()
     Base.metadata.drop_all(engine)
     self.browser.quit()
     if os.environ['CONFIG_PATH'] != 'blog.config.TravisConfig':
         os.system('pgrep phantomjs | xargs kill')
Ejemplo n.º 12
0
 def tearDown(self):
     ''' Test teardown '''
     # remove the tables and their data from the database
     self.process.terminate()
     session.close()
     engine.dispose()
     Base.metadata.drop_all(engine)
     self.browser.quit()
     if os.environ['CONFIG_PATH'] != 'blog.config.TravisConfig':
         os.system('pgrep phantomjs | xargs kill')
    def tearDown(self):
        """ Test teardown """
        # Remove the tables and their data from the db

        # kill server using process.terminate method
        self.process.terminate()
        session.close()
        engine.dispose()
        Base.metadata.drop_all(engine)
        # exit browser using browser.quit method
        self.browser.quit()
Ejemplo n.º 14
0
 def tearDown(self):
     """ Test Teardown """
     # Remove the tables and their data from the database
     
     # Kill the server
     self.process.terminate()
     session.close()
     engine.dispose()
     Base.metadata.drop_all(engine)
     # Exit the browser
     self.browser.quit()
Ejemplo n.º 15
0
 def tearDown(self):
     """ Test teardown """
     session.close()
     # Remove the tables and their data from the database
     Base.metadata.drop_all(engine)
Ejemplo n.º 16
0
 def tearDown(self):
     """ Test teardown """
     session.close()
     
     Base.metadata.drop_all(engine)
Ejemplo n.º 17
0
 def tearDown(self):
     ''' test teardown '''
     session.close()
     # remove the tables and their data from the database
     Base.metadata.drop_all(engine)
Ejemplo n.º 18
0
 def tearDown(self):
     ''' test teardown '''
     session.close()
     # remove the tables and their data from the database
     Base.metadata.drop_all(engine)
Ejemplo n.º 19
0
 def tearDown(self):
     """ Test teardown"""
     session.close()
     #remove tables and data from DB
     Base.metadata.drop_all(engine)