def test_uniqueness_of_user_id(self): """ creates a user, creates a project, removes the user creates a different new user, checks for projects should not find anything """ with self.app.app_context(): response = mscolab_register_and_login(self.app, self.url, '*****@*****.**', 'abcdef', 'alpha') assert response.status == '200 OK' data = json.loads(response.get_data(as_text=True)) response = mscolab_create_content(self.app, self.url, data, path_name='owns_alpha') assert response.status == '200 OK' mscolab_delete_user(self.app, self.url, '*****@*****.**', 'abcdef') response = mscolab_register_and_login(self.app, self.url, '*****@*****.**', 'abcdef', 'delta') assert response.status == '200 OK' data = json.loads(response.get_data(as_text=True)) url = url_join(self.url, 'projects') response = self.app.test_client().get(url, data=data) response = json.loads(response.get_data(as_text=True)) assert len(response['projects']) == 0
def teardown(self): QtTest.QTest.mouseClick(self.window.logoutButton, QtCore.Qt.LeftButton) QtWidgets.QApplication.processEvents() with self.app.app_context(): email = [ ("*****@*****.**", "something"), ("*****@*****.**", "other"), ("*****@*****.**", "anton"), ("*****@*****.**", "berta"), ] for em, username in email: mscolab_delete_all_projects(self.app, self.MSCOLAB_URL_TEST, em, "something", username) mscolab_delete_user(self.app, self.MSCOLAB_URL_TEST, em, "something") # to disconnect connections, and clear token self.window.disconnect_handler() QtWidgets.QApplication.processEvents() self.window.close() QtWidgets.QApplication.processEvents() self.application.quit() QtWidgets.QApplication.processEvents() with fs.open_fs(mscolab_settings.MSCOLAB_DATA_DIR) as mss_dir: if mss_dir.exists('local_mscolab_data'): mss_dir.removetree('local_mscolab_data')
def teardown(self): with self.app.app_context(): mscolab_delete_user(self.app, self.url, '*****@*****.**', 'sdf') if self.window.version_window: self.window.version_window.close() if self.window.conn: self.window.conn.disconnect() self.application.quit() QtWidgets.QApplication.processEvents() self.process.terminate()
def teardown(self): with self.app.app_context(): mscolab_delete_all_projects(self.app, MSCOLAB_URL_TEST, '*****@*****.**', 'abcdef', 'alpha') mscolab_delete_all_projects(self.app, MSCOLAB_URL_TEST, '*****@*****.**', 'user', 'user') for em, pw in [('*****@*****.**', 'abcdef'), ('*****@*****.**', 'user2'), ('*****@*****.**', 'abcdef'), ('*****@*****.**', 'other'), ('*****@*****.**', 'user') ]: server.register_user(em, pw, 'test') mscolab_delete_user(self.app, MSCOLAB_URL_TEST, em, pw) server.db.session.commit()
def teardown(self): with self.app.app_context(): mscolab_delete_all_projects(self.app, self.url, self.emailid, 'abcdef', 'alpha') mscolab_delete_user(self.app, self.url, self.emailid, 'abcdef') with fs.open_fs(mscolab_settings.MSCOLAB_DATA_DIR) as mss_dir: if mss_dir.exists('local_mscolab_data'): mss_dir.removetree('local_mscolab_data') assert mss_dir.exists('local_mscolab_data') is False if self.window.version_window: self.window.version_window.close() if self.window.conn: self.window.conn.disconnect() self.application.quit() QtWidgets.QApplication.processEvents() self.process.terminate()