'Test that validator for mobile phone number is applied'

def testMobilePhoneNumberValidationInternational(self):

    current.deployment_settings.msg.require_international_phone_numbers = True
    from s3db.pr import PRContactModel
    onvalidation = PRContactModel.pr_contact_onvalidation
    form = Storage(vars=Storage(contact_method='SMS'))
    form.errors = Storage()
    form.vars.value = '+46-73-3847589'
    onvalidation(form)
    self.assertEqual(form.vars.value, '+46733847589')
    self.assertFalse(('value' in form.errors))
    form.errors = Storage()
    form.vars.value = '0368172634'
    onvalidation(form)
    self.assertEqual(form.vars.value, '0368172634')
    self.assertTrue(('value' in form.errors))
