def test_status_base_auth():
    user = User('foo')
    user.set_password('foobar')
    store.put(user)
    user_cookie = get_auth('foo', 'foobar')
    change_space_member(store, 'thing', add='foo')

    response, content = http.request('http://0.0.0.0:8080/status',
            headers={'Cookie': 'tiddlyweb_user="******"' % user_cookie})

    assert response['status'] == '200'
    info = simplejson.loads(content)
    assert info['username'] == 'foo'
    assert 'space' not in info
def test_status_base_auth():
    user = User('foo')
    user.set_password('foobar')
    store.put(user)
    user_cookie = get_auth('foo', 'foobar')
    change_space_member(store, 'thing', add='foo')

    response, content = http.request(
        'http://0.0.0.0:8080/status',
        headers={'Cookie': 'tiddlyweb_user="******"' % user_cookie})

    assert response['status'] == '200'
    info = simplejson.loads(content)
    assert info['username'] == 'foo'
    assert 'space' not in info
Beispiel #3
0
 def delmember(args):
     """Delete a member from a space: <space name> <user name>"""
     store = get_store(config)
     space_name, username = args
     change_space_member(store, space_name, remove=username)
     return True
Beispiel #4
0
 def addmember(args):
     """Add a member to a space: <space name> <user name>"""
     store = get_store(config)
     space_name, username = args
     change_space_member(store, space_name, add=username)
     return True
Beispiel #5
0
 def delmember(args):
     """Delete a member from a space: <space name> <user name>"""
     store = get_store(config)
     space_name, username = args
     change_space_member(store, space_name, remove=username)
     return True
Beispiel #6
0
 def addmember(args):
     """Add a member to a space: <space name> <user name>"""
     store = get_store(config)
     space_name, username = args
     change_space_member(store, space_name, add=username)
     return True