web/test/test_views.py
brancholdstable
changeset 6665 90f2f20367bc
parent 6340 470d8e828fda
child 6639 90ae7eb3460f
equal deleted inserted replaced
6018:f4d1d5d9ccbb 6665:90f2f20367bc
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """automatic tests
    18 """automatic tests"""
    19 
       
    20 """
       
    21 
    19 
    22 from cubicweb.devtools.testlib import CubicWebTC, AutoPopulateTest, AutomaticWebTest
    20 from cubicweb.devtools.testlib import CubicWebTC, AutoPopulateTest, AutomaticWebTest
    23 from cubicweb.view import AnyRsetView
    21 from cubicweb.view import AnyRsetView
    24 
    22 
    25 AutomaticWebTest.application_rql = [
    23 AutomaticWebTest.application_rql = [
    66     def test_js_added_only_once(self):
    64     def test_js_added_only_once(self):
    67         self.vreg._loadedmods[__name__] = {}
    65         self.vreg._loadedmods[__name__] = {}
    68         self.vreg.register(SomeView)
    66         self.vreg.register(SomeView)
    69         rset = self.execute('CWUser X')
    67         rset = self.execute('CWUser X')
    70         source = self.view('someview', rset).source
    68         source = self.view('someview', rset).source
    71         self.assertEquals(source.count('spam.js'), 1)
    69         self.assertEqual(source.count('spam.js'), 1)
    72 
    70 
    73 
    71 
    74 
    72 
    75 class ExplicitViewsTest(CubicWebTC):
    73 class ExplicitViewsTest(CubicWebTC):
    76 
    74