Fakultas Ilmu Komputer UI

Commit 99e9b4ce authored by Farah Alhaniy's avatar Farah Alhaniy
Browse files

Fix branch to match master

parent 3890184e
db.sqlite3
geckodriver.log
geckodriver.*
env/
__pycache__
\ No newline at end of file
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.options import Options
import time
import unittest
import environ
env = environ.Env(DEBUG=(bool, False))
environ.Env.read_env('.env')
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
options = Options()
options.headless = True
self.browser = webdriver.Firefox(options=options)
self.browser.implicitly_wait(5)
def tearDown(self):
self.browser.quit()
......@@ -19,17 +28,18 @@ class NewVisitorTest(unittest.TestCase):
def test_can_start_a_list_and_retrieve_it_later(self):
# Edith has heard about a cool new online to-do app. She goes
# to check out its homepage
self.browser.get('http://localhost:8000')
url = env("HEROKU_APP_HOST", default='http://localhost:8000')
self.browser.get(url)
self.assertIn('Homepage - Farah Alhaniy', self.browser.title)
# She notices the page title and header mention to-do lists
# self.assertIn('To-Do', self.browser.title)
header_text = self.browser.find_element_by_tag_name('h1').text
self.assertIn('To-Do', header_text)
self.assertIn('Hi!', header_text)
# She is invited to enter a to-do item straight away
inputbox = self.browser.find_element_by_id('id_new_item')
inputbox = self.browser.find_element_by_id('id_new_item')
self.assertEqual(
inputbox.get_attribute('placeholder'),
'Enter a to-do item'
......@@ -60,10 +70,10 @@ class NewVisitorTest(unittest.TestCase):
# Edith wonders whether the site will remember her list. Then she sees
# that the site has generated a unique URL for her -- there is some
# explanatory text to that effect.
self.fail('Finish the test!')
#self.fail('Finish the test!')
# She visits that URL - her to-do list is still there.
# Satisfied, she goes back to sleep
if __name__ == '__main__':
unittest.main(warnings='ignore')
\ No newline at end of file
unittest.main(warnings='ignore')
......@@ -42,7 +42,7 @@ class HomePageTest(TestCase):
def test_home_page_returns_correct_html(self):
request = HttpRequest()
response = home_page(request)
response = self.client.get('/')
html = response.content.decode('utf8')
self.assertTrue(html.startswith('<html>'))
self.assertIn('<title>Homepage - Farah Alhaniy</title>', html)
......@@ -61,7 +61,7 @@ class HomePageTest(TestCase):
def test_comment_todolist_empty(self):
response = self.client.get('/')
self.assertIn('Yey, waktunya libur', response.content.decode())
self.assertIn('Yey, waktunya berlibur', response.content.decode())
def test_comment_todolist_less_than_5(self):
for i in range(3):
......@@ -77,7 +77,6 @@ class HomePageTest(TestCase):
response = self.client.get('/')
self.assertIn('Oh tidak', response.content.decode())
class ItemModelTest(TestCase):
def test_saving_and_retrieving_items(self):
......
astroid==1.5.3
attrs==19.1.0
bleach==3.1.0
certifi==2018.8.24
chardet==3.0.4
colorama==0.3.9
coverage==4.4.1
decorator==4.4.0
defusedxml==0.5.0
dj-database-url==0.4.2
Django==2.1.1
dj-database-url==0.5.0
Django==2.2.5
django-environ==0.4.4
entrypoints==0.3
flake8==3.4.1
graphviz==0.10.1
gunicorn==19.7.1
idna==2.6
ipython-genutils==0.2.0
isort==4.2.15
Jinja2==2.10
jsonschema==3.0.1
jupyter-core==4.4.0
lazy-object-proxy==1.3.1
MarkupSafe==1.1.1
mccabe==0.6.1
mistune==0.8.4
nbconvert==5.4.1
nbformat==4.4.0
numpy==1.15.4
pandas==0.23.4
pandocfilters==1.4.2
pew==1.0.2
Pillow==5.3.0
pipenv==8.2.6
ply==3.11
psutil==5.3.1
gunicorn==19.9.0
pytz==2018.9
psycopg2==2.7.3.1
pycodestyle==2.3.1
pydotplus==2.0.2
pyflakes==1.5.0
Pygments==2.3.1
pylint==1.7.2
pyparsing==2.3.1
pyrsistent==0.14.11
python-dateutil==2.7.5
pytz==2017.2
requests==2.18.4
selenium==3.5.0
six==1.10.0
testpath==0.4.2
traitlets==4.3.2
typed-ast==1.1.0
urllib3==1.22
virtualenv==15.1.0
virtualenv-clone==0.2.6
webencodings==0.5.1
whitenoise==3.3.0
wrapt==1.10.11
xlrd==1.1.0
selenium==3.141.0
sqlparse==0.3.0
urllib3==1.25.3
whitenoise==4.1.3
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment