コード例 #1
0
 def testGetDefault(self):
     location = CityLocation.get_default(self.store)
     self.failUnless(isinstance(location, CityLocation))
     self.assertEquals(location.city, sysparam(self.store).CITY_SUGGESTED)
     self.assertEquals(location.state, sysparam(self.store).STATE_SUGGESTED)
     self.assertEquals(location.country,
                       sysparam(self.store).COUNTRY_SUGGESTED)
コード例 #2
0
ファイル: test_address.py プロジェクト: sarkis89/stoq
 def test_get_default(self):
     location = CityLocation.get_default(self.store)
     self.failUnless(isinstance(location, CityLocation))
     self.assertEquals(location.city, sysparam.get_string('CITY_SUGGESTED'))
     self.assertEquals(location.state,
                       sysparam.get_string('STATE_SUGGESTED'))
     self.assertEquals(location.country,
                       sysparam.get_string('COUNTRY_SUGGESTED'))
コード例 #3
0
 def test_location_suggested(self):
     location = CityLocation.get_default(self.store)
     self.assertEqual(location.city,
                      self.sparam.get_string('CITY_SUGGESTED'))
     self.assertEqual(location.state,
                      self.sparam.get_string('STATE_SUGGESTED'))
     self.assertEqual(location.country,
                      self.sparam.get_string('COUNTRY_SUGGESTED'))
コード例 #4
0
ファイル: individualtemplate.py プロジェクト: romaia/stoq
    def __init__(self, target, store):
        AttributeForwarder.__init__(self, target)
        self.store = store
        if not target.birth_location:
            target.birth_location = CityLocation.get_default(store)

        self.city = target.birth_location.city
        self.state = target.birth_location.state
        self.country = target.birth_location.country
コード例 #5
0
ファイル: test_address.py プロジェクト: romaia/stoq
 def testGetDefault(self):
     location = CityLocation.get_default(self.store)
     self.failUnless(isinstance(location, CityLocation))
     self.assertEquals(location.city,
                       sysparam(self.store).CITY_SUGGESTED)
     self.assertEquals(location.state,
                       sysparam(self.store).STATE_SUGGESTED)
     self.assertEquals(location.country,
                       sysparam(self.store).COUNTRY_SUGGESTED)
コード例 #6
0
ファイル: test_address.py プロジェクト: EasyDevSolutions/stoq
 def test_get_default(self):
     location = CityLocation.get_default(self.store)
     self.failUnless(isinstance(location, CityLocation))
     self.assertEquals(location.city,
                       sysparam.get_string('CITY_SUGGESTED'))
     self.assertEquals(location.state,
                       sysparam.get_string('STATE_SUGGESTED'))
     self.assertEquals(location.country,
                       sysparam.get_string('COUNTRY_SUGGESTED'))
コード例 #7
0
    def _create_address(self, person, street, streetnumber, postal_code):
        city = CityLocation.get_default(self.store)

        return Address(store=self.store,
                       street=street,
                       streetnumber=streetnumber,
                       postal_code=postal_code,
                       is_main_address=True,
                       person=person,
                       city_location=city)
コード例 #8
0
ファイル: test_nfe.py プロジェクト: LeonamSilva/stoq
    def _create_address(self, person, street, streetnumber, postal_code):
        city = CityLocation.get_default(self.store)

        return Address(store=self.store,
                       street=street,
                       streetnumber=streetnumber,
                       postal_code=postal_code,
                       is_main_address=True,
                       person=person,
                       city_location=city)
コード例 #9
0
ファイル: individualtemplate.py プロジェクト: victornovy/stoq
    def __init__(self, target, store):
        """
        :param model: an Individial
        :param store: a store
        """
        AttributeForwarder.__init__(self, target)
        self.store = store
        if not target.birth_location:
            target.birth_location = CityLocation.get_default(store)

        self.city = target.birth_location.city
        self.state = target.birth_location.state
        self.country = target.birth_location.country
コード例 #10
0
    def __init__(self, target, store):
        """
        :param model: an Individial
        :param store: a store
        """
        AttributeForwarder.__init__(self, target)
        self.store = store
        if not target.birth_location:
            target.birth_location = CityLocation.get_default(store)

        self.city = target.birth_location.city
        self.state = target.birth_location.state
        self.country = target.birth_location.country
コード例 #11
0
    def __init__(self, target, store, ui_form_name=None):
        """
        :param target: an Individial
        :param store: a store
        """
        # Even though we dont use ui_form_name anywhere in this class, its setup
        # is made in a way we need this argument. see persontemplate
        # attach_model_slave method
        AttributeForwarder.__init__(self, target)
        self.store = store
        if not target.birth_location:
            target.birth_location = CityLocation.get_default(store)

        self.city = target.birth_location.city
        self.state = target.birth_location.state
        self.country = target.birth_location.country
コード例 #12
0
    def __init__(self, target, store, ui_form_name=None):
        """
        :param target: an Individial
        :param store: a store
        """
        # Even though we dont use ui_form_name anywhere in this class, its setup
        # is made in a way we need this argument. see persontemplate
        # attach_model_slave method
        AttributeForwarder.__init__(self, target)
        self.store = store
        if not target.birth_location:
            target.birth_location = CityLocation.get_default(store)

        self.city = target.birth_location.city
        self.state = target.birth_location.state
        self.country = target.birth_location.country
コード例 #13
0
ファイル: test_pos.py プロジェクト: amaurihamasu/stoq
    def _create_client(self, store):
        from stoqlib.domain.address import Address, CityLocation
        from stoqlib.domain.person import Client, Person

        person = Person(name=u'Person', store=store)
        city = CityLocation.get_default(store)
        Address(store=store,
                street=u'Rua Principal',
                streetnumber=123,
                postal_code=u'12345-678',
                is_main_address=True,
                person=person,
                city_location=city)
        client = Client(person=person, store=store)
        client.credit_limit = currency("1000")
        return client
コード例 #14
0
    def _create_client(self, store):
        from stoqlib.domain.address import Address, CityLocation
        from stoqlib.domain.person import Client, Person

        person = Person(name=u'Person', store=store)
        city = CityLocation.get_default(store)
        Address(store=store,
                street=u'Rua Principal',
                streetnumber=123,
                postal_code=u'12345-678',
                is_main_address=True,
                person=person,
                city_location=city)
        client = Client(person=person, store=store)
        client.credit_limit = currency("1000")
        return client
コード例 #15
0
 def get_location(self):
     from stoqlib.domain.address import CityLocation
     return CityLocation.get_default(self.store)
コード例 #16
0
ファイル: test_parameters.py プロジェクト: Guillon88/stoq
 def test_location_suggested(self):
     location = CityLocation.get_default(self.store)
     self.assertEqual(location.city, self.sparam.get_string('CITY_SUGGESTED'))
     self.assertEqual(location.state, self.sparam.get_string('STATE_SUGGESTED'))
     self.assertEqual(location.country, self.sparam.get_string('COUNTRY_SUGGESTED'))
コード例 #17
0
 def create_model(self, store):
     return Address(person=self.person,
                    city_location=CityLocation.get_default(store),
                    is_main_address=False,
                    store=store)
コード例 #18
0
ファイル: addresseditor.py プロジェクト: pauloscarin1972/stoq
 def create_model(self, store):
     return Address(person=self.person,
                    city_location=CityLocation.get_default(store),
                    is_main_address=False,
                    store=store)
コード例 #19
0
ファイル: test_parameters.py プロジェクト: tmaxter/stoq
 def testLocationSuggested(self):
     location = CityLocation.get_default(self.store)
     self.assertEqual(location.city, self.sparam.CITY_SUGGESTED)
     self.assertEqual(location.state, self.sparam.STATE_SUGGESTED)
     self.assertEqual(location.country, self.sparam.COUNTRY_SUGGESTED)
コード例 #20
0
ファイル: test_parameters.py プロジェクト: romaia/stoq
 def testLocationSuggested(self):
     location = CityLocation.get_default(self.store)
     self.assertEqual(location.city, self.sparam.CITY_SUGGESTED)
     self.assertEqual(location.state, self.sparam.STATE_SUGGESTED)
     self.assertEqual(location.country, self.sparam.COUNTRY_SUGGESTED)
コード例 #21
0
ファイル: addressslave.py プロジェクト: 5l1v3r1/stoq-1
 def create_model(self, store):
     address = Address(person=self.person,
                       city_location=CityLocation.get_default(store),
                       is_main_address=self.is_main_address,
                       store=store)
     return _AddressModel(address, store)
コード例 #22
0
 def get_location(self):
     from stoqlib.domain.address import CityLocation
     return CityLocation.get_default(self.store)