def test_by_owner_id(self):
    number = PhoneNumber.objects.create(domain=self.domain, owner_doc_type='X', owner_id='owner1', phone_number='999123', verified=True, pending_verification=False, is_two_way=True)
    [lookup] = PhoneNumber.by_owner_id('owner1')
    self.assertEqual(lookup, number)
    number.owner_id = 'owner2'
    number.save()
    self.assertEqual(PhoneNumber.by_owner_id('owner1'), [])
    [lookup] = PhoneNumber.by_owner_id('owner2')
    self.assertEqual(lookup, number)
    number.verified = False
    number.is_two_way = False
    number.save()
    [lookup] = PhoneNumber.by_owner_id('owner2')
    self.assertFalse(lookup.verified)
    self.assertFalse(lookup.is_two_way)
def test_by_owner_id(self):
    number = PhoneNumber.objects.create(domain=self.domain, owner_doc_type='X', owner_id='owner1', phone_number='999123', verified=True, pending_verification=False, is_two_way=True)
    [lookup] = PhoneNumber.by_owner_id('owner1')
    self.assertEqual(lookup, number)
    number.owner_id = 'owner2'
    number.save()
    self.assertEqual(PhoneNumber.by_owner_id('owner1'), [])
    [lookup] = PhoneNumber.by_owner_id('owner2')
    self.assertEqual(lookup, number)
    number.verified = False
    number.is_two_way = False
    number.save()
    [lookup] = PhoneNumber.by_owner_id('owner2')
    self.assertFalse(lookup.verified)
    self.assertFalse(lookup.is_two_way)