def test_list_labels_present(self, label_factory): l1 = label_factory(name='etykieta1') l2 = label_factory(name='etykieta2') rv = self.runner.invoke(label_list) assert rv.exit_code == 0 assert truncate_string(l1.name, 80) in rv.output assert truncate_string(l2.name, 80) in rv.output
def test_list_ok(self, page_factory, attachment_factory): p_title = 'Tytuł strony 1' page = page_factory(title=p_title) a_title = 'Tytuł załącznika 1' attachment_factory(page=page, title=a_title) rv = self.runner.invoke(attachment_list, []) assert truncate_string(a_title, 80) in rv.output assert truncate_string(p_title, 80) in rv.output
def test_list_inactive_only(self, page_factory): p1 = page_factory(active=True, created_by=self.user, updated_by=self.user) p2 = page_factory(active=False, created_by=self.user, updated_by=self.user) rv = self.runner.invoke(page_list, ['--inactive']) assert rv.exit_code == 0 assert truncate_string(p1.title, 80) not in rv.output assert truncate_string(p2.title, 80) in rv.output