'unsign should raise an exception if the value has been tampered with'

def unsign_detects_tampering(self):

    signer = signing.Signer(u'predictable-secret')
    value = u'Another    string'
    signed_value = signer.sign(value)
    transforms = ((lambda s: s.upper()), (lambda s: (s + u'a')), (lambda s: (u'a' + s[1:])), (lambda s: s.replace(u':', u'')))
    self.assertEqual(value, signer.unsign(signed_value))
    for transform in transforms:
        self.assertRaises(signing.BadSignature, signer.unsign, transform(signed_value))
