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

20 lines
768 B
Python
Raw Normal View History

2016-09-30 23:13:41 +01:00
from tests import TestCase
2016-09-11 21:26:30 +01:00
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)
2016-09-30 23:13:41 +01:00
for post in blogs:
2016-09-11 21:26:30 +01:00
url = os.path.join(post.find('a').attrs['href'], 'index.html')
self.assertTrue(self.client.exists(url))
2016-09-30 23:13:41 +01:00
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))