def test_register_user(self): """ Basic Registration Test """ self.app.post("/register", data=self.getUser(), follow_redirects=True) user = User.getByName("mdrahali") user.email_confirmation = True user.change_configuration = {} user.update_record() assert Database.count_record('users', {'username': "******"}) == 1 """ Invalid Username """ invalid_user = self.getUser() invalid_user['username'] = "******" response = self.app.post("/register", data=invalid_user, follow_redirects=True) assert "Username must contain only letters numbers or underscore" in str( response.data)