def test_returns_wrong_upc_codes(self): self.assertFalse(product_gtin.check_upc("")) # test string self.assertFalse(product_gtin.check_upc("odoo_oca")) # less than 12 numbers self.assertFalse(product_gtin.check_upc("12345678901")) # 12 random numbers self.assertFalse(product_gtin.check_upc("123456789013")) # more than 12 numbers self.assertFalse(product_gtin.check_upc("12345678980123"))
def test_ean13_codes(self): """Ean13 codes should not be valid for UPC.""" for code in VALID_EAN13_CODES: _logger.debug('code: {}'.format(code)) self.assertFalse(product_gtin.check_upc(code))
def test_upc_codes(self): for code in VALID_UPC_CODES: _logger.debug('code: {}'.format(code)) self.assertTrue(product_gtin.check_upc(code))