Beispiel #1
0
 def test_css(self):
     content_type = BaseContentType(request=None, request_kwargs=None)
     css = content_type.css()
     self.assertEquals(css.count('@import url("base.css");'), 1, 'One of the css files was duplicated')
     self.assertIn('@import url("base.css");', css, 'One of the css files was missing')
     self.assertEquals(css.count('@import url("base2a.css");'), 1, 'One of the css files was duplicated')
     self.assertIn('@import url("base2a.css");', css, 'One of the css files was missing')
     self.assertEquals(css.count('@import url("base2b.css");'), 1, 'One of the css files was duplicated')
     self.assertIn('@import url("base2b.css");', css, 'One of the css files was missing')
     self.assertEquals(css.count('@import url("base3.css");'), 1, 'One of the css files was duplicated')
     self.assertIn('@import url("base3.css");', css, 'One of the css files was missing')
Beispiel #2
0
 def test_get_context_with_request(self):
     content_type = BaseContentType(request=mock_data.mock_request(), request_kwargs=None)
     context = content_type._get_context()
     self.assertIsInstance(context, RequestContext, 'context was not a dictionary')
Beispiel #3
0
 def test_get_context(self):
     content_type = BaseContentType(request=None, request_kwargs=None)
     context = content_type._get_context()
     self.assertIsInstance(context, dict, 'context was not a dictionary')
Beispiel #4
0
 def test_get_template(self):
     content_type = BaseContentType(request=None, request_kwargs=None)
     content_type._template = mock_data.mock_template
     template = content_type._get_template()
     self.assertEquals(template, 'ampcms/%s.html' % mock_data.mock_template, '_get_template() returned incorrect template: %s' % template)
Beispiel #5
0
 def test_get_data_tags(self):
     content_type = BaseContentType(request=None, request_kwargs=None)
     data_tags = content_type.get_html_data_tags()
     self.assertDictEqual(data_tags, {'data-data_a':'val_a', 'data-data_b': 'val_b'}, 'data_tags was not the correct dictionary: %s' % data_tags)
Beispiel #6
0
 def test_markup(self):
     content_type = BaseContentType(request=None, request_kwargs=None)
     html = content_type.markup()
     self.assertIsInstance(html, Markup, 'html was not a markup object: %s' % type(html))
     self.assertEqual(html, '<p>var_a : val_a. var_b : val_b.</p>', 'html was incorrect: %s' % html)
Beispiel #7
0
 def test_html(self):
     content_type = BaseContentType(request=None, request_kwargs=None)
     html = content_type.html()
     self.assertEqual(html, '<p>var_a : val_a. var_b : val_b.</p>', 'html was incorrect: %s' % html)