Beispiel #1
0
 def test_empty_metadata_title_is_not_extended(self):
     create_metadata(url_path='/', title='', title_extend=True)
     context = metadata(create_request('/'))
     with translation.override('en'):
         self.assertEqual(context['metadata'].title, '')
Beispiel #2
0
 def test_metadata_is_empty_if_url_path_doesnt_match(self):
     create_metadata(url_path='/about/')
     context = metadata(create_request('/'))
     with translation.override('en'):
         self.assertMetadataIsEmpty(context['metadata'])
Beispiel #3
0
 def test_metadata_is_present_if_enabled(self):
     create_metadata(url_path='/')
     context = metadata(create_request('/'))
     with translation.override('en'):
         self.assertMetadataIsPresent(context['metadata'])
Beispiel #4
0
 def test_metadata_is_empty_if_disabled(self):
     create_metadata(url_path='/', enabled=False)
     context = metadata(create_request('/'))
     self.assertMetadataIsEmpty(context['metadata'])
Beispiel #5
0
 def test_metadata_is_empty_if_does_not_exist(self):
     context = metadata(create_request('/'))
     self.assertMetadataIsEmpty(context['metadata'])
Beispiel #6
0
 def test_metadata_object_is_lazy(self):
     request = create_request('/')
     with self.assertNumQueries(0):
         metadata(request)