Пример #1
0
  def testValidData(self):
    """Tests that address entity is created properly if all data is valid."""
    result = address_logic.createAddress(
        TEST_STREET, TEST_CITY, TEST_COUNTRY, TEST_POSTAL_CODE,
        province=TEST_PROVINCE, name=TEST_NAME, street_extra=TEST_STREET_EXTRA)
    self.assertTrue(result)

    address = result.extra
    self.assertEqual(address.name, TEST_NAME)
    self.assertEqual(address.street, TEST_STREET)
    self.assertEqual(address.street_extra, TEST_STREET_EXTRA)
    self.assertEqual(address.city, TEST_CITY)
    self.assertEqual(address.province, TEST_PROVINCE)
    self.assertEqual(address.country, TEST_COUNTRY)
    self.assertEqual(address.postal_code, TEST_POSTAL_CODE)
Пример #2
0
    def testValidData(self):
        """Tests that address entity is created properly if all data is valid."""
        result = address_logic.createAddress(TEST_STREET,
                                             TEST_CITY,
                                             TEST_COUNTRY,
                                             TEST_POSTAL_CODE,
                                             province=TEST_PROVINCE,
                                             name=TEST_NAME,
                                             street_extra=TEST_STREET_EXTRA)
        self.assertTrue(result)

        address = result.extra
        self.assertEqual(address.name, TEST_NAME)
        self.assertEqual(address.street, TEST_STREET)
        self.assertEqual(address.street_extra, TEST_STREET_EXTRA)
        self.assertEqual(address.city, TEST_CITY)
        self.assertEqual(address.province, TEST_PROVINCE)
        self.assertEqual(address.country, TEST_COUNTRY)
        self.assertEqual(address.postal_code, TEST_POSTAL_CODE)
Пример #3
0
 def testInvalidData(self):
   """Tests that address entity is not created if data is not valid."""
   # non-existing country
   result = address_logic.createAddress(
       TEST_STREET, TEST_CITY, 'Neverland', TEST_POSTAL_CODE)
   self.assertFalse(result)
Пример #4
0
 def testInvalidData(self):
     """Tests that address entity is not created if data is not valid."""
     # non-existing country
     result = address_logic.createAddress(TEST_STREET, TEST_CITY,
                                          'Neverland', TEST_POSTAL_CODE)
     self.assertFalse(result)