Commit b06ab3d8 authored by Claude Paroz's avatar Claude Paroz

Updated deprecated test assertions

parent cb237201
......@@ -327,7 +327,7 @@ class ModuleTestCase(TestCase):
po_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'test.po')
domain = self.mod.domain_set.get(name='po')
fr_lang = Language.objects.get(locale='fr')
with self.assertRaisesRegexp(Exception, 'read-only mode'):
with self.assertRaisesRegex(Exception, 'read-only mode'):
branch.commit_po(po_file, domain, fr_lang, 'Author <someone@example.org>')
self.mod.vcs_root = self.mod.vcs_root.replace('git://', 'ssh://')
self.mod.save()
......
......@@ -82,15 +82,15 @@ class TeamTest(TeamsAndRolesTests):
self.assertEqual(pcoords[0], self.pcoo)
members = team.get_committers_exact()
self.assert_(len(members), 1)
self.assertEqual(len(members), 1)
self.assertEqual(members[0], self.pc)
members = team.get_reviewers_exact()
self.assert_(len(members), 1)
self.assertEqual(len(members), 1)
self.assertEqual(members[0], self.pr)
members = team.get_translators_exact()
self.assert_(len(members), 1)
self.assertEqual(len(members), 1)
self.assertEqual(members[0], self.pt)
def test_roles_exact(self):
......@@ -109,17 +109,17 @@ class TeamTest(TeamsAndRolesTests):
members = team.get_committers()
self.assertEqual(len(members), 2)
for pc in members:
self.assert_(pc in [self.pcoo, self.pc])
self.assertTrue(pc in [self.pcoo, self.pc])
members = team.get_reviewers()
self.assertEqual(len(members), 3)
for pc in members:
self.assert_(pc in [self.pcoo, self.pc, self.pr])
self.assertTrue(pc in [self.pcoo, self.pc, self.pr])
members = team.get_translators()
self.assertEqual(len(members), 4)
for pc in members:
self.assert_(pc in [self.pcoo, self.pc, self.pr, self.pt])
self.assertTrue(pc in [self.pcoo, self.pc, self.pr, self.pt])
def test_roles(self):
self.run_roles_test(self.t)
......
......@@ -671,8 +671,8 @@ class VertimusTest(TeamsAndRolesTests):
actions_db = Action.objects.filter(state_db__id=state.id).exclude(name='WC').order_by('-id')
# So the last action is UNDO
self.assert_(isinstance(actions_db[0], ActionUNDO))
self.assertIsInstance(actions_db[0], ActionUNDO)
# Here be dragons! A call to len() workaround the Django/MySQL bug!
len(actions_db)
self.assert_(isinstance(actions_db[0], ActionUNDO))
self.assertIsInstance(actions_db[0], ActionUNDO)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment