def test_ais_success(app): ensure_correct_depot(app) path = module_path('onegov.file', 'tests/fixtures/example.pdf') tape = module_path('onegov.file', 'tests/cassettes/ais-success.json') # recordings were shamelessly copied from AIS.py's unit tests with vcr.use_cassette(tape, record_mode='none'): with open(path, 'rb') as infile: assert b'/SigFlags' not in infile.read() infile.seek(0) outfile = BytesIO() request_id = app.signing_service.sign(infile, outfile) name, customer, id = request_id.split('/') assert name == 'swisscom_ais' assert customer == 'foo' assert is_uuid(id) outfile.seek(0) assert b'/SigFlags' in outfile.read() outfile.seek(0)
def by_id(self, id): if utils.is_uuid(id): return self.query().filter(Person.id == id).first()
def by_id(self, id): if is_uuid(id): return self.query().filter(Recipient.id == id).first()