def test_validate_recipient_id_success(): """ Testing a run of a valid recipient id """ recipient_id = "00077a9a-5a70-8919-fd19-330762af6b84-P" mommy.make("recipient.RecipientProfile", **TEST_RECIPIENT_PROFILES[recipient_id]) expected_hash = recipient_id[:-2] expected_level = recipient_id[-1] try: recipient_hash, recipient_level = recipients.validate_recipient_id(recipient_id) assert recipient_hash == expected_hash assert recipient_level == expected_level except InvalidParameterException: assert False
def test_validate_recipient_id_success(): """ Testing a run of a valid recipient id """ recipient_id = '00077a9a-5a70-8919-fd19-330762af6b84-P' mommy.make(RecipientProfile, **TEST_RECIPIENT_PROFILES[recipient_id]) expected_hash = recipient_id[:-2] expected_level = recipient_id[-1] try: recipient_hash, recipient_level = recipients.validate_recipient_id(recipient_id) assert recipient_hash == expected_hash assert recipient_level == expected_level except InvalidParameterException: assert False
def call_validate_recipient_id(recipient_id): try: recipients.validate_recipient_id(recipient_id) return False except InvalidParameterException: return True
def call_validate_recipient_id(recipient_id): try: recipients.validate_recipient_id(recipient_id) return False except InvalidParameterException: return True