'loads should raise exception for tampered objects'

def test_decode_detects_tampering(self):

    transforms = ((lambda s: s.upper()), (lambda s: (s + u'a')), (lambda s: (u'a' + s[1:])), (lambda s: s.replace(u':', u'')))
    value = {u'foo': u'bar', u'baz': 1}
    encoded = signing.dumps(value)
    self.assertEqual(value, signing.loads(encoded))
    for transform in transforms:
        self.assertRaises(signing.BadSignature, signing.loads, transform(encoded))
