@@ -719,16 +719,16 @@ class TestProjectPage(SeleniumFunctionalTestCase):
remove_layer_btn.click()
self.wait_until_visible('#change-notification', poll=2)
change_notification = self.find('#change-notification')
- self.assertTrue(
- f'You have removed 1 layer from your project' in str(change_notification.text)
+ self.assertIn(
+ f'You have removed 1 layer from your project', str(change_notification.text)
)
# check add layer button works, 18 is the random layer id
add_layer_btn = self.find('#add-remove-layer-btn')
add_layer_btn.click()
self.wait_until_visible('#change-notification')
change_notification = self.find('#change-notification')
- self.assertTrue(
- f'You have added 1 layer to your project' in str(change_notification.text)
+ self.assertIn(
+ f'You have added 1 layer to your project', str(change_notification.text)
)
# check tabs(layers, recipes, machines) are displayed
tabs = self.find_all('.nav-tabs li')
"False is not True" is not a helpful error messgae. "XXX not in YYY" is much more helpful. Tweak the test to give more meaninful failure messages using assertIn rather than assertTrue. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- lib/toaster/tests/functional/test_project_page.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)