def test_backend(self):
    backend1 = SQLTestSMSBackend.objects.create(hq_api_id=SQLTestSMSBackend.get_api_id(), is_global=False, domain=self.domain, name='BACKEND1')
    backend2 = SQLTestSMSBackend.objects.create(hq_api_id=SQLTestSMSBackend.get_api_id(), is_global=False, domain=self.domain, name='BACKEND2')
    SQLMobileBackendMapping.set_default_domain_backend(self.domain, backend1)
    number = PhoneNumber(domain=self.domain, phone_number='+999123')
    self.assertEqual(number.backend, backend1)
    number.backend_id = backend2.name
    self.assertEqual(number.backend, backend2)
    number.backend_id = '  '
    self.assertEqual(number.backend, backend1)
def test_backend(self):
    backend1 = SQLTestSMSBackend.objects.create(hq_api_id=SQLTestSMSBackend.get_api_id(), is_global=False, domain=self.domain, name='BACKEND1')
    backend2 = SQLTestSMSBackend.objects.create(hq_api_id=SQLTestSMSBackend.get_api_id(), is_global=False, domain=self.domain, name='BACKEND2')
    SQLMobileBackendMapping.set_default_domain_backend(self.domain, backend1)
    number = PhoneNumber(domain=self.domain, phone_number='+999123')
    self.assertEqual(number.backend, backend1)
    number.backend_id = backend2.name
    self.assertEqual(number.backend, backend2)
    number.backend_id = '  '
    self.assertEqual(number.backend, backend1)