Changeset View
Changeset View
Standalone View
Standalone View
common/tests/test_meta.py
| Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | def test_homepage(self): | ||||
| self.assertCanonicalLinkEquals(html, 'http://testserver/') | self.assertCanonicalLinkEquals(html, 'http://testserver/') | ||||
| for meta, value in { | for meta, value in { | ||||
| 'property=.og:url.': 'http://testserver/', | 'property=.og:url.': 'http://testserver/', | ||||
| **shared_meta, | **shared_meta, | ||||
| 'property=.og:title.': 'Blender Cloud', | 'property=.og:title.': 'Blender Cloud', | ||||
| 'name=.twitter:title.': 'Blender Cloud', | 'name=.twitter:title.': 'Blender Cloud', | ||||
| 'property=.og:description.': 'Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.', | 'property=.og:description.': 'Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.', | ||||
| 'name=.twitter:description.': 'Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.', | 'name=.twitter:description.': 'Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.', | ||||
| 'property=.og:image.': 'http://testserver/static/common/images/blender-cloud-og.c39b3abab36d.jpg', | 'property=.og:image.': 'http://testserver/static/common/images/blender-cloud-og.jpg', | ||||
| 'name=.twitter:image.': 'http://testserver/static/common/images/blender-cloud-og.c39b3abab36d.jpg', | 'name=.twitter:image.': 'http://testserver/static/common/images/blender-cloud-og.jpg', | ||||
| }.items(): | }.items(): | ||||
| self.assertMetaEquals(html, meta, value) | self.assertMetaEquals(html, meta, value) | ||||
| def test_welcome(self): | def test_welcome(self): | ||||
| page_url = reverse('welcome') | page_url = reverse('welcome') | ||||
| response = self.client.get(page_url + '?foo=bar') | response = self.client.get(page_url + '?foo=bar') | ||||
| self.assertEqual(response.status_code, 200) | self.assertEqual(response.status_code, 200) | ||||
| html = response.content | html = response.content | ||||
| self.assertCanonicalLinkEquals(html, 'http://testserver/welcome/') | self.assertCanonicalLinkEquals(html, 'http://testserver/welcome/') | ||||
| for meta, value in { | for meta, value in { | ||||
| 'property=.og:url.': 'http://testserver/welcome/', | 'property=.og:url.': 'http://testserver/welcome/', | ||||
| **shared_meta, | **shared_meta, | ||||
| 'property=.og:title.': 'Blender Cloud', | 'property=.og:title.': 'Blender Cloud', | ||||
| 'name=.twitter:title.': 'Blender Cloud', | 'name=.twitter:title.': 'Blender Cloud', | ||||
| 'property=.og:description.': 'Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.', | 'property=.og:description.': 'Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.', | ||||
| 'name=.twitter:description.': 'Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.', | 'name=.twitter:description.': 'Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.', | ||||
| 'property=.og:image.': 'http://testserver/static/common/images/blender-cloud-og.c39b3abab36d.jpg', | 'property=.og:image.': 'http://testserver/static/common/images/blender-cloud-og.jpg', | ||||
| 'name=.twitter:image.': 'http://testserver/static/common/images/blender-cloud-og.c39b3abab36d.jpg', | 'name=.twitter:image.': 'http://testserver/static/common/images/blender-cloud-og.jpg', | ||||
| }.items(): | }.items(): | ||||
| self.assertMetaEquals(html, meta, value) | self.assertMetaEquals(html, meta, value) | ||||
| def test_film(self): | def test_film(self): | ||||
| film_slug = 'coffee-run' | film_slug = 'coffee-run' | ||||
| film = FilmFactory(slug=film_slug) | film = FilmFactory(slug=film_slug) | ||||
| page_url = reverse('film-detail', kwargs={'film_slug': film_slug}) | page_url = reverse('film-detail', kwargs={'film_slug': film_slug}) | ||||
| ▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines | |||||