Skip to content

Commit adf69f5

Browse files
committed
Working on templates
1 parent f6c7b51 commit adf69f5

21 files changed

+11393
-19
lines changed

functional_tests/__init__.py

Whitespace-only changes.

functional_tests/all_users.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

functional_tests/test_all_users.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- coding: utf-8 -*-
2+
from selenium import webdriver
3+
import unittest
4+
from django.core.urlresolvers import reverse
5+
from django.contrib.staticfiles.testing import LiveServerTestCase
6+
7+
'''
8+
class NewVisitorTest(unittest.TestCase):
9+
def setUp(self):
10+
self.browser = webdriver.Firefox()
11+
self.browser.implicitly_wait(3)
12+
13+
def tearDown(self):
14+
self.browser.quit()
15+
16+
def test_it_worked(self):
17+
self.browser.get('http://localhost:8000')
18+
self.assertIn('Welcome to Django', self.browser.title)
19+
'''
20+
class HomeNewVisitorTest(LiveServerTestCase):
21+
22+
def setUp(self):
23+
self.browser = webdriver.Firefox()
24+
self.browser.implicitly_wait(3)
25+
26+
def tearDown(self):
27+
self.browser.quit()
28+
29+
def get_full_url(self, namespace):
30+
return self.live_server_url + reverse(namespace)
31+
32+
def test_home_title(self):
33+
self.browser.get(self.get_full_url("home"))
34+
self.assertIn("TaskBuster", self.browser.title)
35+
36+
def test_h1_css(self):
37+
self.browser.get(self.get_full_url("home"))
38+
h1 = self.browser.find_element_by_tag_name("h1")
39+
self.assertEqual(h1.value_of_css_property("color"),
40+
"rgba(200, 50, 255, 1)")
41+
42+
43+
44+
if __name__ == '__main__':
45+
unittest.main(warnings='ignore')
46+

taskbuster/settings/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def get_env_variable(var_name):
6262
TEMPLATES = [
6363
{
6464
'BACKEND': 'django.template.backends.django.DjangoTemplates',
65-
'DIRS': [],
65+
'DIRS': [os.path.join(BASE_DIR,"templates")],
6666
'APP_DIRS': True,
6767
'OPTIONS': {
6868
'context_processors': [
@@ -107,3 +107,6 @@ def get_env_variable(var_name):
107107
# https://docs.djangoproject.com/en/1.8/howto/static-files/
108108

109109
STATIC_URL = '/static/'
110+
STATICFILES_DIRS = (
111+
os.path.join(BASE_DIR,'static'),
112+
)
3.87 KB
Loading

taskbuster/static/browserconfig.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Please read: http://msdn.microsoft.com/en-us/library/ie/dn455106.aspx -->
3+
<browserconfig>
4+
<msapplication>
5+
<tile>
6+
<square70x70logo src="tile.png"/>
7+
<square150x150logo src="tile.png"/>
8+
<wide310x150logo src="tile-wide.png"/>
9+
<square310x310logo src="tile.png"/>
10+
</tile>
11+
</msapplication>
12+
</browserconfig>

0 commit comments

Comments
 (0)