Ejemplo n.º 1
0
 def test_user_from_browserid(self):
     user = User.from_browserid({
         'email': '*****@*****.**',
         'issuer': 'pudo.org'
     })
     assert user is not None, user
     assert User.objects.count() == 1, User.objects.all()
Ejemplo n.º 2
0
    def test_user_session(self):
        user = User.from_browserid({"email": "*****@*****.**", "issuer": "pudo.org"})

        data = json.loads(self.app.get("/api/1/sessions").get_data())
        assert not data.get("logged_in"), data

        with self.app.session_transaction() as sess:
            sess["user_id"] = user.email
            sess["_fresh"] = True

        data = json.loads(self.app.get("/api/1/sessions").get_data())
        assert data.get("logged_in"), data
        assert data.get("user").get("email") == user.email
Ejemplo n.º 3
0
    def test_user_session(self):
        user = User.from_browserid({
            'email': '*****@*****.**',
            'issuer': 'pudo.org'
        })

        data = json.loads(self.app.get('/api/1/sessions').get_data())
        assert not data.get('logged_in'), data

        with self.app.session_transaction() as sess:
            sess['user_id'] = user.email
            sess['_fresh'] = True

        data = json.loads(self.app.get('/api/1/sessions').get_data())
        assert data.get('logged_in'), data
        assert data.get('user').get('email') == user.email
Ejemplo n.º 4
0
def get(id):
    user = obj_or_404(User.by_id(id))
    #require.service.view(service)
    return jsonify(user)
Ejemplo n.º 5
0
 def test_user_from_browserid(self):
     user = User.from_browserid({"email": "*****@*****.**", "issuer": "pudo.org"})
     assert user is not None, user
     assert User.objects.count() == 1, User.objects.all()
Ejemplo n.º 6
0
def get(id):
    user = obj_or_404(User.by_id(id))
    #require.service.view(service)
    return jsonify(user)