def test_success_true(self): """ If all shove instances executed the command successfully, return True. """ command = SentCommandFactory.create() CommandLogFactory.create_batch(2, sent_command=command, return_code=0) assert_true(command.success)
def test_get_context_data(self): sent_command = SentCommandFactory.create() log1, log2 = CommandLogFactory.create_batch(2, sent_command=sent_command) view = views.SentCommandDetails() view.kwargs = {'project_id': sent_command.project.id} view.object = sent_command # Required for get_context_data. ctx = view.get_context_data() assert_equal(ctx['project'], sent_command.project) assert_equal(list(ctx['logs']), [log1, log2])