def clean_mobile_phone(self): mobile_number = self.cleaned_data.get('mobile_phone') if len(DataSenderOnTrialAccount.objects.filter(mobile_number=(mobile_number))) > 0 or \ mobile_number in get_trial_account_user_phone_numbers(): raise ValidationError( _("This phone number is already in use. Please supply a different phone number" )) return self.cleaned_data.get('mobile_phone')
def clean_mobile_phone(self): mobile_number = self.cleaned_data.get('mobile_phone') if get_data_senders_on_trial_account_with_mobile_number(mobile_number).count() > 0 or\ mobile_number in get_trial_account_user_phone_numbers(): raise ValidationError( _("This phone number is already in use. Please supply a different phone number" )) return self.cleaned_data.get('mobile_phone')
def test_get_mobile_numbers_for_trial_account(self): self.assertEqual(TRIAL_ACCOUNT_USERS_MOBILE_NUMBERS,get_trial_account_user_phone_numbers())