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()
 def tearDown(self):
     """ Test Teardown """
     self.process.terminate()
     session.close()
     engine.dispose()
     Base.metadata.drop_all(engine)
     self.browser.quit()
Beispiel #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()
    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)
 def tearDown(self):
   """
   Test teardown
   """
   session.close()
   # Remove the tables and their data from the database
   Base.metadata.drop_all(engine)
Beispiel #6
0
 def tearDown(self):
     """ Test teardown """
     self.process.terminate()
     session.close()
     engine.dispose()
     Base.metadata.drop_all(engine)
     self.browser.quit()
 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)
Beispiel #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()
 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
Beispiel #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
 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 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()
Beispiel #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()
Beispiel #15
0
 def tearDown(self):
     """ Test teardown """
     session.close()
     # Remove the tables and their data from the database
     Base.metadata.drop_all(engine)
 def tearDown(self):
     """ Test teardown """
     session.close()
     
     Base.metadata.drop_all(engine)
 def tearDown(self):
     ''' test teardown '''
     session.close()
     # remove the tables and their data from the database
     Base.metadata.drop_all(engine)
 def tearDown(self):
     ''' test teardown '''
     session.close()
     # remove the tables and their data from the database
     Base.metadata.drop_all(engine)
 def tearDown(self):
     """ Test teardown"""
     session.close()
     #remove tables and data from DB
     Base.metadata.drop_all(engine)