Use assertGreater(len(x), 0) instead of assertTrue(len(x) > 0)

assertGreater provides a nicer error message if it fails.

Change-Id: I1aeb25dfea1b497d0c9fd0c2990f39872e9c4d4c
This commit is contained in:
Cao Xuan Hoang 2016-12-08 15:48:40 +07:00
parent 5e84308572
commit 5b99e9fe83

View File

@ -20,4 +20,4 @@ class BrowserTests(test.SeleniumTestCase):
self.selenium.get(self.live_server_url)
button = self.selenium.find_element_by_id("loginBtn")
# Ensure button has something; must be language independent.
self.assertTrue(len(button.text) > 0)
self.assertGreater(len(button.text), 0)