Beispiel #1
0
    def test_inbound_loads_data(self, request, session):
        session.data = pickle.dumps({"hello": 5})
        session.save()
        request.cookie['session_key'] = "a" * 64
        inbound(request)

        assert len(Session.objects()) == 1
        assert request.session['session_key'] == "a" * 64
        assert request.session['hello'] == 5
Beispiel #2
0
 def test_inbound_key_no_session(self, request):
     request.cookie['session_key'] = "a" * 64
     inbound(request)
     assert request.session.keys() == ["session_key"]
Beispiel #3
0
 def test_inbound_key_session(self, request, session):
     request.cookie['session_key'] = "a" * 64
     assert len(Session.objects()) == 1
     inbound(request)
     assert len(Session.objects()) == 1
     assert request.session['session_key'] == "a" * 64
Beispiel #4
0
 def test_inbound_no_key(self, request):
     inbound(request)
     assert request.session.keys() == ["session_key"]
     assert len(Session.objects()) == 1
     assert Session.objects()[0]['session_key'] == request.session['session_key']