def test_scrub_request():
    tests = (
        'password',
        'PASSWORD',
        'password2',
        'confirmpassword',
        'PaSsWorD',
    )

    e = DatabaseError()
    rf = RequestFactory()
    hpoe = ScrubRequestOnException()

    def hidden(password):
        sessionid = 'qwertyuiopasdfghjklzxcvbnm'
        rf.cookies['sessionid'] = sessionid
        post = rf.post('/foo', {password: 'foo'})
        eq_(post.POST[password], 'foo')
        eq_(post.COOKIES['sessionid'], sessionid)
        assert post.META['HTTP_COOKIE'] in sessionid
        hpoe.process_exception(post, e)
        eq_(post.POST[password], '******')
        eq_(post.COOKIES['sessionid'], '******')
        eq_(post.META['HTTP_COOKIE'], '******')

    for pw in tests:
        yield hidden, pw
dataset/ETHPy150Open jsocol/commonware/commonware/exceptions/tests.py/test_scrub_request/swapped operands of `in`