python-stdnum branch master updated. 1.18-35-gf6edcc5
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum branch master updated. 1.18-35-gf6edcc5
- From: Commits of the python-stdnum project <python-stdnum-commits [at] lists.arthurdejong.org>
- To: python-stdnum-commits [at] lists.arthurdejong.org
- Reply-to: python-stdnum-users [at] lists.arthurdejong.org, python-stdnum-commits [at] lists.arthurdejong.org
- Subject: python-stdnum branch master updated. 1.18-35-gf6edcc5
- Date: Sun, 20 Aug 2023 14:20:17 +0200 (CEST)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".
The branch, master has been updated
via f6edcc55927134344809005569d1416c86ab1909 (commit)
from 895f092318ea02bdc3c7bc81a46c570c3180d3e2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=f6edcc55927134344809005569d1416c86ab1909
commit f6edcc55927134344809005569d1416c86ab1909
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sun Aug 20 14:02:20 2023 +0200
Avoid the deprecated assertRegexpMatches function
diff --git a/tests/test_do_rnc.py b/tests/test_do_rnc.py
index 9ea06c9..5eebeeb 100644
--- a/tests/test_do_rnc.py
+++ b/tests/test_do_rnc.py
@@ -1,7 +1,7 @@
# test_do_rnc.py - functions for testing the online RNC validation
# coding: utf-8
#
-# Copyright (C) 2017 Arthur de Jong
+# Copyright (C) 2017-2023 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -36,6 +36,12 @@ class TestDGII(unittest.TestCase):
"""Test the web services provided by the the Dirección General de
Impuestos Internos (DGII), the Dominican Republic tax department."""
+ def setUp(self):
+ """Prepare the test."""
+ # For Python 2.7 compatibility
+ if not hasattr(self, 'assertRegex'):
+ self.assertRegex = self.assertRegexpMatches
+
def test_check_dgii(self):
"""Test stdnum.do.rnc.check_dgii()"""
# Test a normal valid number
@@ -63,9 +69,9 @@ class TestDGII(unittest.TestCase):
# Search for some existing companies
results = rnc.search_dgii('EXPORT DE')
self.assertGreaterEqual(len(results), 3)
- self.assertRegexpMatches(results[0]['rnc'], r'\d{9}')
- self.assertRegexpMatches(results[1]['rnc'], r'\d{9}')
- self.assertRegexpMatches(results[2]['rnc'], r'\d{9}')
+ self.assertRegex(results[0]['rnc'], r'\d{9}')
+ self.assertRegex(results[1]['rnc'], r'\d{9}')
+ self.assertRegex(results[2]['rnc'], r'\d{9}')
# Check maximum rows parameter
two_results = rnc.search_dgii('EXPORT DE', end_at=2)
self.assertEqual(len(two_results), 2)
-----------------------------------------------------------------------
Summary of changes:
tests/test_do_rnc.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
hooks/post-receive
--
python-stdnum
- python-stdnum branch master updated. 1.18-35-gf6edcc5,
Commits of the python-stdnum project