def setUp(self):
        appcomposer.app.config['DEBUG'] = True
        appcomposer.app.config['TESTING'] = True
        appcomposer.app.config['CSRF_ENABLED'] = False
        appcomposer.app.config["SECRET_KEY"] = 'secret'
        self.flask_app = appcomposer.app.test_client()

        # In case the test failed before, start from a clean state.
        self._cleanup()

        with self.flask_app:
            self.flask_app.get("/")
            self.user1 = create_user("utuser1", "Test User 1", "password")
            self.user2 = create_user("utuser2", "Test User 2", "password")
            rv = self.login("utuser1", "password")
Ejemplo n.º 2
0
 def test_created_user_login(self):
     user = create_user("utuser", "Unit Test User", "password")
     self.login("utuser", "password")
     print session
     assert session["logged_in"]
 
     rv = self.client.get("/user/")
     assert rv.status_code == 200
Ejemplo n.º 3
0
    def test_created_user_login(self):
        user = create_user("utuser", "Unit Test User", "password")
        self.login("utuser", "password")
        print session
        assert session["logged_in"]

        rv = self.client.get("/user/")
        assert rv.status_code == 200
Ejemplo n.º 4
0
    def test_user_creation_deletion(self):
        user = create_user("utuser", "Unit Test User", "password")
        assert user is not None

        user = get_user_by_login("NOTEXISTS_utuser")
        assert user is None

        user = get_user_by_login("utuser")
        assert user is not None

        user = remove_user(user)

        user = get_user_by_login("utuser")
        assert user is None
Ejemplo n.º 5
0
    def test_user_creation_deletion(self):
        user = create_user("utuser", "Unit Test User", "password")
        assert user is not None

        user = get_user_by_login("NOTEXISTS_utuser")
        assert user is None

        user = get_user_by_login("utuser")
        assert user is not None

        user = remove_user(user)

        user = get_user_by_login("utuser")
        assert user is None