Пример #1
0
    def test_get_signups(self):
         with routes.app.test_request_context():
            database.add_registered_user(["Linus", "Kortesalmi", "*****@*****.**",
                                          "Sweden", "Linkoping", "g_plus"])
            expected_answer = [{'city': u'Linkoping', 'country': u'Sweden', 'name': u'Linus Kortesalmi',
                                'reference': u'g_plus', 'email': u'*****@*****.**'}]

            self.assertEquals(database.get_signups(), expected_answer)
Пример #2
0
def show_signups():
    try:
        # Check if we are logged in this session.
        if not session['logged_in']:
            abort(401)
        return render_template('show_signups.html', signups=database.get_signups())
    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'))