Example #1
0
 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
Example #2
0
 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
Example #3
0
 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
Example #4
0
 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
Example #5
0
 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
Example #6
0
 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
Example #7
0
 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
Example #8
0
 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
Example #9
0
 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
Example #10
0
    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
Example #11
0
    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
Example #12
0
 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
Example #13
0
 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
Example #14
0
 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
Example #15
0
    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
Example #16
0
    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
Example #17
0
                                   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.
Example #18
0
        # 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.