1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/tests/tests_pages.py
2016-09-30 23:13:41 +01:00

19 lines
768 B
Python

from tests import TestCase
import os.path
class HomepageTestCase(TestCase):
def test_blog_links(self):
content = self.client.get('index.html')
blogs = content.find('section', id='blog').find_all('div', class_="col-xs-12")
self.assertTrue(len(blogs) <= 4)
for post in blogs:
url = os.path.join(post.find('a').attrs['href'], 'index.html')
self.assertTrue(self.client.exists(url))
def test_projects(self):
content = self.client.get('index.html')
projects = content.find('section', id='projects').find_all('a', class_='portfolio-box')
for project in projects:
url = os.path.join(project.attrs['href'], 'index.html')
self.assertTrue(self.client.exists(url))