def test_rekey_ignores_recently_keyed_records(self): self.crusher.encrypting_packer = self.rekey_setup() assert rekey(self.db, self.crusher.encrypting_packer) == 1 assert rekey(self.db, self.crusher.encrypting_packer) == 0
#!/usr/bin/env python2 """See gratipay.models.participant.mixins.identity.rekey for documentation. """ from __future__ import absolute_import, division, print_function, unicode_literals from gratipay import wireup from gratipay.models.participant.mixins import identity as participant_identities env = wireup.env() db = wireup.db(env) packer = wireup.crypto(env) n = participant_identities.rekey(db, packer) print("Rekeyed {} participant identity record(s).".format(n))
def test_rekeying_causes_old_packer_to_fail(self): rekey(self.db, self.rekey_setup()) raises(InvalidToken, self.crusher.retrieve_identity_info, self.US)
def test_rekey_rekeys(self): assert rekey(self.db, self.rekey_setup()) == 1