コード例 #1
0
    def test_complete_session_no_kinto_signoff(self):
        server = KintoServer('foo', 'baa', kinto_sign_off_needed=False)
        server._setup_done = True
        # should return because nothing to signoff
        server.complete_session()

        server._changes = True
        url = (settings.KINTO_API_URL + 'buckets/foo/collections/baa')
        responses.add(responses.PATCH, url, content_type='application/json')
        server.complete_session()
        assert not server._changes
        assert responses.calls[0].request.body == json.dumps({
            'data': {
                'status': 'to-sign'
            }
        }).encode()
コード例 #2
0
    def test_complete_session(self):
        server = KintoServer('foo', 'baa')
        server._setup_done = True
        # should return because nothing to signoff
        server.complete_session()

        server._changes = True
        url = (
            settings.REMOTE_SETTINGS_WRITER_URL +
            'buckets/foo/collections/baa')
        responses.add(
            responses.PATCH,
            url,
            content_type='application/json')
        server.complete_session()
        assert not server._changes
        assert responses.calls[0].request.body == json.dumps(
            {'data': {'status': 'to-review'}}).encode()