def setUp(self): self.app = app.test_client() self.accounts_collection = accounts_collection self.accounts_collection.delete_many( {'username': correct_account_data['username']}) self.expected_fields = { 'firstName', 'lastName', 'studyGroup', 'role', 'username', 'id' }
def setUp(self): self.app = app.test_client() self.accounts_collection = accounts_collection self.insufficient_data_acc = {'username': '******'} self.illegal_username = { 'username': '******' * (validators.MIN_USERNAME_LENGTH - 1), 'password': '******' * validators.MIN_PASSWORD_LENGTH, 'firstName': 'A' * validators.MIN_NAME_COMPONENT_LENGTH, 'email': '*****@*****.**', 'lastName': 'B' * validators.MIN_NAME_COMPONENT_LENGTH } self.illegal_password = { 'username': '******' * validators.MIN_USERNAME_LENGTH, 'password': '******' * (validators.MIN_PASSWORD_LENGTH - 1), 'firstName': 'A' * validators.MIN_NAME_COMPONENT_LENGTH, 'email': '*****@*****.**', 'lastName': 'B' * validators.MIN_NAME_COMPONENT_LENGTH } self.illegal_input_data_acc = { 'username': '******' * validators.MIN_USERNAME_LENGTH, 'password': '******' * validators.MIN_PASSWORD_LENGTH, 'firstName': 'A' * (validators.MIN_NAME_COMPONENT_LENGTH - 1), 'email': '*****@*****.**', 'lastName': 'B' * (validators.MIN_NAME_COMPONENT_LENGTH - 1) } self.illegal_optional_input_data_acc = { 'username': '******' * validators.MIN_USERNAME_LENGTH, 'password': '******' * validators.MIN_PASSWORD_LENGTH, 'firstName': 'A' * validators.MIN_NAME_COMPONENT_LENGTH, 'email': '*****@*****.**', 'lastName': 'B' * validators.MIN_NAME_COMPONENT_LENGTH, 'studyGroup': 'Z' * (validators.MIN_STUDY_GROUP_LENGTH - 1) } self.correct_required_input_data = correct_account_data self.correct_optional_input_data = { 'username': '******' * validators.MIN_USERNAME_LENGTH, 'password': '******' * validators.MIN_PASSWORD_LENGTH, 'firstName': 'f' * validators.MAX_NAME_COMPONENT_LENGTH, 'email': '*****@*****.**', 'lastName': 'c' * validators.MAX_NAME_COMPONENT_LENGTH, 'studyGroup': 'Z' * validators.MIN_STUDY_GROUP_LENGTH } # be sure not to have any test accounts before we run tests self.accounts_collection.delete_many(self.insufficient_data_acc) self.accounts_collection.delete_many( {'username': self.correct_required_input_data['username']}) self.response_required_fields = { 'id', 'token', 'username', 'firstName', 'lastName', 'role' }
def setUp(self): self.app = app.test_client() self.correct_input_data = { 'username': '******' * validators.MIN_USERNAME_LENGTH, 'password': '******' * validators.MIN_PASSWORD_LENGTH, 'firstName': 'f' * validators.MAX_NAME_COMPONENT_LENGTH, 'lastName': 'c' * validators.MAX_NAME_COMPONENT_LENGTH, 'email': '*****@*****.**' } self.correct_auth_data = { 'username': self.correct_input_data['username'], 'password': self.correct_input_data['password'] }
def setUp(self): self.region_name = 'us-east-1' self.table_name = 'test-Criteria' app.config.from_object('config.TestConfig') self.app = app.test_client()
async def test_index(app): test_client = app.test_client() resp = await test_client.get("/") assert resp.status_code == 200
def setUp(self): self.app = app.test_client() self.accounts_collection = accounts_collection self.accounts_collection.delete_many( {'username': correct_account_data['username']})
def setUp(self): app.config.from_object('config.TestConfig') self.app = app.test_client()