Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-11-22T14:32:54+01:00
Author: Philip Bauer (pbauer) <bauer@starzel.de>
Commit: https://github.com/plone/plone.app.contenttypes/commit/516086f7ede72dbe240d454eafef34fc4185e112

call view only once

Files changed:
M plone/app/contenttypes/tests/test_document.py

diff --git a/plone/app/contenttypes/tests/test_document.py b/plone/app/contenttypes/tests/test_document.py
index 9f8c044..947c531 100644
--- a/plone/app/contenttypes/tests/test_document.py
+++ b/plone/app/contenttypes/tests/test_document.py
@@ -73,12 +73,12 @@ def test_view(self):
         self.request.set('ACTUAL_URL', document.absolute_url())
         alsoProvides(self.request, IPloneFormLayer)
         view = document.restrictedTraverse('@@view')
-
-        self.assertTrue(view())
         self.assertEqual(view.request.response.status, 200)
-        self.assertTrue('My Document' in view())
-        self.assertTrue('This is my document.' in view())
-        self.assertTrue('Lorem ipsum' in view())
+        output = view()
+        self.assertTrue(output)
+        self.assertTrue('My Document' in output)
+        self.assertTrue('This is my document.' in output)
+        self.assertTrue('Lorem ipsum' in output)
 
     def tearDown(self):
         if 'document' in self.portal.objectIds():