def test_home(self): """Test the home page works.""" try: return self.app.post('/', data=dict(), follow_redirects=True) except Exception, e: LOGGER.exception('Basic front page load failed.') raise e
def test_home(self): """Test the home page works.""" try: return self.app.post("/", data=dict(), follow_redirects=True) except Exception, e: LOGGER.exception("Basic front page load failed.") raise e
def test_download_view(self): """Test the download_view function. """ url = '/download' try: return self.app.get(url, data=dict(), follow_redirects=True) except Exception, e: LOGGER.exception('Basic front page load failed.') raise e
def test_download_view(self): """Test the download_view function. """ url = "/download" try: return self.app.get(url, data=dict(), follow_redirects=True) except Exception, e: LOGGER.exception("Basic front page load failed.") raise e
def test_edit_user_view(self): """Test the edit_user_view function. """ guid = add_user(**self.correct_user_data) url = '/edit/%s' % guid try: return self.app.get(url, data=dict(), follow_redirects=True) except Exception, e: LOGGER.exception('Basic front page load failed.') raise e
def test_edit_user_view(self): """Test the edit_user_view function. """ guid = add_user(**self.correct_user_data) url = "/edit/%s" % guid try: return self.app.get(url, data=dict(), follow_redirects=True) except Exception, e: LOGGER.exception("Basic front page load failed.") raise e
def test_add_user_view(self): """Test the user added json response works.""" # Test correct data try: result = self.app.post("/add_user", data=self.correct_user_data, follow_redirects=True) data = result.__getattribute__("data") self.assertTrue("Akbar" in data) except Exception, e: LOGGER.exception("Page load failed.") raise e
def test_users_view(self): """Test the users json response works.""" guid = add_user(**self.correct_user_data) if guid is not None: try: result = self.app.post("/users.json", data=dict(user_role=1), follow_redirects=True) data = result.__getattribute__("data") self.assertTrue("Akbar" in data) except Exception, e: LOGGER.exception("Basic front page load failed.") raise e
def test_add_user_view(self): """Test the user added json response works.""" # Test correct data try: result = self.app.post('/add_user', data=self.correct_user_data, follow_redirects=True) data = result.__getattribute__('data') self.assertTrue('Akbar' in data) except Exception, e: LOGGER.exception('Page load failed.') raise e
def test_delete_user_view(self): """Test the delete_user_view function. """ guid = add_user(**self.correct_user_data) url = '/delete/%s' % guid try: self.app.post(url, data=dict(), follow_redirects=True) user = get_user(guid) self.assertIsNone(user) except Exception, e: LOGGER.exception('Basic front page load failed.') raise e
def test_delete_user_view(self): """Test the delete_user_view function. """ guid = add_user(**self.correct_user_data) url = "/delete/%s" % guid try: self.app.post(url, data=dict(), follow_redirects=True) user = get_user(guid) self.assertIsNone(user) except Exception, e: LOGGER.exception("Basic front page load failed.") raise e
def test_edit_user_controller(self): """Test the edit_user_view function. """ guid = add_user(**self.correct_user_data) self.edited_user_data["guid"] = guid url = "/edit_user" try: result = self.app.post(url, data=self.edited_user_data, follow_redirects=True) data = result.__getattribute__("data") self.assertTrue("Akbar Gumbira" in data) except Exception, e: LOGGER.exception("Basic front page load failed.") raise e
def test_users_view(self): """Test the users json response works.""" guid = add_user(**self.correct_user_data) if guid is not None: try: result = self.app.post('/users.json', data=dict(user_role=1), follow_redirects=True) data = result.__getattribute__('data') self.assertTrue('Akbar' in data) except Exception, e: LOGGER.exception('Basic front page load failed.') raise e
def test_edit_user_controller(self): """Test the edit_user_view function. """ guid = add_user(**self.correct_user_data) self.edited_user_data['guid'] = guid url = '/edit_user' try: result = self.app.post(url, data=self.edited_user_data, follow_redirects=True) data = result.__getattribute__('data') self.assertTrue('Akbar Gumbira' in data) except Exception, e: LOGGER.exception('Basic front page load failed.') raise e
def test_reminder_view(self): """Test the download_view function. """ url = "/reminder" # Test OK guid = add_user(**self.correct_user_data) if guid is not None: email = self.correct_user_data["email"] try: result = self.app.post(url, data=dict(email=email), follow_redirects=True) data = result.__getattribute__("data") self.assertTrue("Success" in data) except Exception, e: LOGGER.exception("Basic front page load failed.") raise e
def test_reminder_view(self): """Test the download_view function. """ url = '/reminder' # Test OK guid = add_user(**self.correct_user_data) if guid is not None: email = self.correct_user_data['email'] try: result = self.app.post(url, data=dict(email=email), follow_redirects=True) data = result.__getattribute__('data') self.assertTrue('Success' in data) except Exception, e: LOGGER.exception('Basic front page load failed.') raise e
follow_redirects=True) data = result.__getattribute__('data') self.assertTrue('Akbar' in data) except Exception, e: LOGGER.exception('Page load failed.') raise e # Test wrong data try: result = self.app.post('/add_user', data=self.wrong_user_data, follow_redirects=True) data = result.__getattribute__('data') self.assertTrue('Error' in data) except Exception, e: LOGGER.exception('Page load failed.') raise e def test_edit_user_view(self): """Test the edit_user_view function. """ guid = add_user(**self.correct_user_data) url = '/edit/%s' % guid try: return self.app.get(url, data=dict(), follow_redirects=True) except Exception, e: LOGGER.exception('Basic front page load failed.') raise e def test_edit_user_controller(self): """Test the edit_user_view function.
# Test correct data try: result = self.app.post("/add_user", data=self.correct_user_data, follow_redirects=True) data = result.__getattribute__("data") self.assertTrue("Akbar" in data) except Exception, e: LOGGER.exception("Page load failed.") raise e # Test wrong data try: result = self.app.post("/add_user", data=self.wrong_user_data, follow_redirects=True) data = result.__getattribute__("data") self.assertTrue("Error" in data) except Exception, e: LOGGER.exception("Page load failed.") raise e def test_edit_user_view(self): """Test the edit_user_view function. """ guid = add_user(**self.correct_user_data) url = "/edit/%s" % guid try: return self.app.get(url, data=dict(), follow_redirects=True) except Exception, e: LOGGER.exception("Basic front page load failed.") raise e def test_edit_user_controller(self): """Test the edit_user_view function.