Ejemplo n.º 1
0
 def test_active_theme(self):
     with self.app.test_request_context('/'):
         appdata = render_template('active.html').strip()
         cooldata = render_theme_template('cool', 'active.html').strip()
         plaindata = render_theme_template('plain', 'active.html').strip()
         self.assertEqual(appdata, 'Application, Active theme: none')
         self.assertEqual(cooldata, 'Cool Blue v2, Active theme: cool')
         self.assertEqual(plaindata, 'Application, Active theme: plain')
Ejemplo n.º 2
0
 def test_active_theme(self):
     with self.app.test_request_context('/'):
         appdata = render_template('active.html').strip()
         cooldata = render_theme_template('cool', 'active.html').strip()
         plaindata = render_theme_template('plain', 'active.html').strip()
         self.assertEqual(appdata, 'Application, Active theme: none')
         self.assertEqual(cooldata, 'Cool Blue v2, Active theme: cool')
         self.assertEqual(plaindata, 'Application, Active theme: plain')
Ejemplo n.º 3
0
 def test_extend(self):
     with self.app.test_request_context('/'):
         data = render_theme_template('cool', 'extending.html').strip()
         self.assertIsNotNone(data)
         self.assertEqual(data, 'hello I am theme_layout')
Ejemplo n.º 4
0
 def test_theme_static(self):
     with self.app.test_request_context('/'):
         coolurl = static_file_url('cool', 'style.css')
         cooldata = render_theme_template('cool', 'static.html').strip()
         self.assertEqual(cooldata, 'Cool Blue v2, {}'.format(coolurl))
Ejemplo n.º 5
0
 def test_render_theme_template(self):
     with self.app.test_request_context('/'):
         coolsrc = render_theme_template('cool', 'hello.html').strip()
         plainsrc = render_theme_template('plain', 'hello.html').strip()
         self.assertEqual(coolsrc, 'Hello from Cool Blue v2.')
         self.assertEqual(plainsrc, 'Hello from the application')
Ejemplo n.º 6
0
 def test_extend(self):
     with self.app.test_request_context('/'):
         data = render_theme_template('cool', 'extending.html').strip()
         self.assertIsNotNone(data)
         self.assertEqual(data, 'hello I am theme_layout')
Ejemplo n.º 7
0
 def test_theme_static(self):
     with self.app.test_request_context('/'):
         coolurl = static_file_url('cool', 'style.css')
         cooldata = render_theme_template('cool', 'static.html').strip()
         self.assertEqual(cooldata, 'Cool Blue v2, {}'.format(coolurl))
Ejemplo n.º 8
0
 def test_render_theme_template(self):
     with self.app.test_request_context('/'):
         coolsrc = render_theme_template('cool', 'hello.html').strip()
         plainsrc = render_theme_template('plain', 'hello.html').strip()
         self.assertEqual(coolsrc, 'Hello from Cool Blue v2.')
         self.assertEqual(plainsrc, 'Hello from the application')