def test_basic_support(self): c = EncryptedCookie(crypter_or_keys_location=KEYS_DIR) assert c.new assert not c.modified assert not c.should_save c['x'] = 42 assert c.modified assert c.should_save s = c.serialize() c2 = EncryptedCookie.unserialize(s, KEYS_DIR) assert c is not c2 assert not c2.new assert not c2.modified assert not c2.should_save assert c2 == c c3 = EncryptedCookie.unserialize(s, KEYS_DIR_BADKEY) assert not c3.modified assert not c3.new assert c3 == {}