From 45edd746cc9d4eb0a3a1392f1256e4b9b179994c Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Fri, 24 May 2019 00:04:27 -0700 Subject: [PATCH] Used re.Pattern.findall() instead of re.findall() in inspectdb.tests. --- tests/inspectdb/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py index 2dc65eb309c..13a0d291070 100644 --- a/tests/inspectdb/tests.py +++ b/tests/inspectdb/tests.py @@ -215,7 +215,7 @@ class InspectDBTestCase(TestCase): call_command('inspectdb', 'inspectdb_uniquetogether', stdout=out) output = out.getvalue() self.assertIn(" unique_together = (('", output) - unique_together_match = re.findall(self.unique_re, output) + unique_together_match = self.unique_re.findall(output) # There should be one unique_together tuple. self.assertEqual(len(unique_together_match), 1) fields = unique_together_match[0] @@ -244,7 +244,7 @@ class InspectDBTestCase(TestCase): ) output = out.getvalue() self.assertIn('# A unique constraint could not be introspected.', output) - self.assertEqual(re.findall(self.unique_re, output), ["('id', 'people_unique')"]) + self.assertEqual(self.unique_re.findall(output), ["('id', 'people_unique')"]) finally: with connection.cursor() as c: c.execute('DROP INDEX Findex')