Ejemplo n.º 1
0
    def test_get_persons_and_ids(self):
         with routes.app.test_request_context():
            database.add_registered_user(["Linus", "Kortesalmi", "*****@*****.**",
                                          "Sweden", "Linkpping", "g_plus"])
            expected_answer = [{'id': 1, 'name': u'Linus Kortesalmi'}]

            self.assertEquals(database.get_persons_and_ids(), expected_answer)
Ejemplo n.º 2
0
def create_group():
    try:
        # Check if we are logged in this session.
        if not session['logged_in']:
            abort(401)
        return render_template('create_group.html', signups=database.get_persons_and_ids())
    except KeyError:
        # Visualize for the user that something went wrong.
        flash('You need to be logged in to view that page')
        return redirect(url_for('home'))