Esempio n. 1
0
    def test_get_by_phone_number(self):
        person = self.create_person()

        self.assertTrue(
            Person.get_by_phone_number(self.store, u'1138').is_empty())
        person.phone_number = u'1138'
        self.assertFalse(
            Person.get_by_phone_number(self.store, u'1138').is_empty())
        person.phone_number = u'0'
        self.assertTrue(
            Person.get_by_phone_number(self.store, u'1138').is_empty())
        person.mobile_number = u'1138'
        self.assertFalse(
            Person.get_by_phone_number(self.store, u'1138').is_empty())
Esempio n. 2
0
    def test_get_by_phone_number(self):
        person = self.create_person()

        self.assertTrue(Person.get_by_phone_number(
            self.store, u'1138').is_empty())
        person.phone_number = u'1138'
        self.assertFalse(Person.get_by_phone_number(
            self.store, u'1138').is_empty())
        person.phone_number = u'0'
        self.assertTrue(Person.get_by_phone_number(
            self.store, u'1138').is_empty())
        person.mobile_number = u'1138'
        self.assertFalse(Person.get_by_phone_number(
            self.store, u'1138').is_empty())
Esempio n. 3
0
 def next_step(self):
     if self.individual_check.get_active():
         role_type = Person.ROLE_INDIVIDUAL
     else:
         role_type = Person.ROLE_COMPANY
     phone_number = self.model.phone_number
     persons = Person.get_by_phone_number(self.store, phone_number)
     if persons.is_empty():
         return RoleEditorStep(self.wizard, self.store, self, role_type, phone_number=phone_number)
     else:
         return ExistingPersonStep(self.wizard, self.store, self, role_type, persons, phone_number=phone_number)
Esempio n. 4
0
 def next_step(self):
     if self.individual_check.get_active():
         role_type = Person.ROLE_INDIVIDUAL
     else:
         role_type = Person.ROLE_COMPANY
     phone_number = self.model.phone_number
     persons = Person.get_by_phone_number(self.store, phone_number)
     if persons.is_empty():
         return RoleEditorStep(self.wizard,
                               self.store,
                               self,
                               role_type,
                               phone_number=phone_number)
     else:
         return ExistingPersonStep(self.wizard,
                                   self.store,
                                   self,
                                   role_type,
                                   persons,
                                   phone_number=phone_number)