Ejemplo n.º 1
0
def reset_should_clear_data():
    storage = CookieStorage('name', 'namespace')
    storage.steps = {'step1': Step('step1')}

    expected = '{"current_step":null,"steps":{"step1":{"files":null,"data":null}}}'
    assert storage.encode() == '%s$%s' % (storage.hmac(expected), expected)

    storage.reset()

    expected = '{"current_step":null,"steps":{}}'
    assert storage.encode() == '%s$%s' % (storage.hmac(expected), expected)
Ejemplo n.º 2
0
def reset_should_clear_data():
    storage = CookieStorage('name', 'namespace')
    storage.steps = {'step1': Step('step1')}

    expected = '{"current_step":null,"steps":{"step1":{"files":null,"data":null}}}'
    assert storage.encode() == '%s$%s' % (storage.hmac(expected), expected)

    storage.reset()

    expected = '{"current_step":null,"steps":{}}'
    assert storage.encode() == '%s$%s' % (storage.hmac(expected), expected)