Commit 82d3aa4d authored by Michal Čihař's avatar Michal Čihař

Simplify failing check test to work with fixups (issue #257)

parent b5494925
......@@ -380,32 +380,19 @@ class EditTest(ViewTestCase):
# Save with failing check
response = self.edit_unit(
'Hello, world!\n',
'Nazdar svete!'
'Hello, world!\n',
)
# We should stay on current message
self.assertRedirectsOffset(response, self.translate_url, 0)
unit = self.get_unit()
self.assertEqual(unit.target, 'Nazdar svete!')
self.assertEqual(unit.target, 'Hello, world!\n')
self.assertTrue(unit.has_failing_check)
self.assertEqual(len(unit.checks()), 2)
self.assertEqual(len(unit.active_checks()), 2)
self.assertEqual(unit.translation.failing_checks, 1)
# Ignore one of checks
check_id = unit.checks()[0].id
response = self.client.get(
reverse('js-ignore-check', kwargs={'check_id': check_id})
)
self.assertContains(response, 'ok')
# Should have one less check
unit = self.get_unit()
self.assertTrue(unit.has_failing_check)
self.assertEqual(len(unit.checks()), 2)
self.assertEqual(len(unit.checks()), 1)
self.assertEqual(len(unit.active_checks()), 1)
self.assertEqual(unit.translation.failing_checks, 1)
# Ignore second checks
check_id = unit.active_checks()[0].id
# Ignore check
check_id = unit.checks()[0].id
response = self.client.get(
reverse('js-ignore-check', kwargs={'check_id': check_id})
)
......@@ -413,7 +400,7 @@ class EditTest(ViewTestCase):
# Should have one less check
unit = self.get_unit()
self.assertFalse(unit.has_failing_check)
self.assertEqual(len(unit.checks()), 2)
self.assertEqual(len(unit.checks()), 1)
self.assertEqual(len(unit.active_checks()), 0)
self.assertEqual(unit.translation.failing_checks, 0)
......
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