Used re.Pattern.findall() instead of re.findall() in inspectdb.tests.
This commit is contained in:
parent
58df8aa40f
commit
45edd746cc
|
@ -215,7 +215,7 @@ class InspectDBTestCase(TestCase):
|
||||||
call_command('inspectdb', 'inspectdb_uniquetogether', stdout=out)
|
call_command('inspectdb', 'inspectdb_uniquetogether', stdout=out)
|
||||||
output = out.getvalue()
|
output = out.getvalue()
|
||||||
self.assertIn(" unique_together = (('", output)
|
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.
|
# There should be one unique_together tuple.
|
||||||
self.assertEqual(len(unique_together_match), 1)
|
self.assertEqual(len(unique_together_match), 1)
|
||||||
fields = unique_together_match[0]
|
fields = unique_together_match[0]
|
||||||
|
@ -244,7 +244,7 @@ class InspectDBTestCase(TestCase):
|
||||||
)
|
)
|
||||||
output = out.getvalue()
|
output = out.getvalue()
|
||||||
self.assertIn('# A unique constraint could not be introspected.', output)
|
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:
|
finally:
|
||||||
with connection.cursor() as c:
|
with connection.cursor() as c:
|
||||||
c.execute('DROP INDEX Findex')
|
c.execute('DROP INDEX Findex')
|
||||||
|
|
Loading…
Reference in New Issue