Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CSCI 40 Lab 1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lance Michael O. Co
CSCI 40 Lab 1
Commits
2638ba33
Commit
2638ba33
authored
Mar 07, 2020
by
Lance Michael O. Co
😢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first test urls
parent
004f0eb9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
5 deletions
+74
-5
geckodriver.log
geckodriver.log
+16
-0
tests.py
heroes/tests.py
+20
-1
urls.py
heroes/urls.py
+10
-0
views.py
heroes/views.py
+13
-1
lab1_functional_test.py
lab1_functional_test.py
+11
-2
urls.py
superlists/urls.py
+4
-1
settings.cpython-38.pyc
willowisp/__pycache__/settings.cpython-38.pyc
+0
-0
No files found.
geckodriver.log
View file @
2638ba33
...
@@ -31,3 +31,19 @@ JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't fin
...
@@ -31,3 +31,19 @@ JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't fin
###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv
###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv
1583580526682 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\Acer\\AppData\\Local\\Temp\\rust_mozprofileALnWTP"
1583580527095 addons.webextension.doh-rollout@mozilla.org WARN Loading extension 'doh-rollout@mozilla.org': Reading manifest: Invalid extension permission: networkStatus
1583580527422 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons
1583580527422 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry
1583580527422 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/
1583580527423 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader*
JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
1583580529086 Marionette INFO Listening on port 57285
1583580529301 Marionette WARN TLS certificate errors will be ignored for this session
1583580532315 Marionette INFO Stopped listening on port 57285
###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv
heroes/tests.py
View file @
2638ba33
# heroes/test.py
from
django.urls
import
resolve
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.http
import
HttpRequest
from
.views
import
home_page
class
HomePageTest
(
TestCase
):
def
test_root_url_resolves_to_home_page_view
(
self
):
found
=
resolve
(
'/'
)
self
.
assertEqual
(
found
.
func
,
home_page
)
def
test_home_page_returns_correct_html
(
self
):
request
=
HttpRequest
()
response
=
home_page
(
request
)
html
=
response
.
content
.
decode
(
'utf8'
)
self
.
assertTrue
(
html
.
startswith
(
'<html>'
))
self
.
assertIn
(
'<title>To-Do lists</title>'
,
html
)
self
.
assertTrue
(
html
.
endswith
(
'</html>'
))
# Create your tests here.
heroes/urls.py
View file @
2638ba33
# This file is to be created inside the lists app folder
# lists/urls.py
from
django.conf.urls
import
url
from
.views
import
home_page
urlpatterns
=
[
url
(
r'^$'
,
home_page
,
name
=
'home_page'
),
]
\ No newline at end of file
heroes/views.py
View file @
2638ba33
# heroes/views.py
from
django.shortcuts
import
render
from
django.shortcuts
import
render
# Create your views here.
def
home_page
(
request
):
return
render
(
request
,
'home.html'
)
def
detail_cloud
(
request
):
return
render
(
request
,
'cloud.html'
)
def
detail_sunflowey
(
request
):
return
render
(
request
,
'sunflowey.html'
)
def
detail_jester
(
request
):
return
render
(
request
,
'jester.html'
)
lab1_functional_test.py
View file @
2638ba33
...
@@ -19,13 +19,22 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -19,13 +19,22 @@ class NewVisitorTest(unittest.TestCase):
# She sees a list containing three heroes with their corresponding
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
# names, health points, and damage
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
input
=
self
.
browser
.
find_element_by_id
(
'id_new_item'
)
self
.
assertEqual
(
input
.
get_attribute
(
'placeholder'
),
'Enter a to-do item'
)
# When she selects one of the heroes, she is sent to another page
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
# containing more information about the hero (additional stats, lore, image).
#test for the urls and others
# She spots the page title and header mentions the name of the hero she selected.
# She spots the page title and header mentions the name of the hero she selected.
self
.
assertIn
(
hero
,
self
.
browser
.
title
)
# While she is in a specific hero's page, she sees a button labeled "Back to Heroes List".
# While she is in a specific hero's page, she sees a button labeled "Back to Heroes List".
# She clicks this and she is redirected back to the wiki's homepage.
# She clicks this and she is redirected back to the wiki's homepage.
#test for redirect thingo
self
.
fail
(
'Finish the test!'
)
self
.
fail
(
'Finish the test!'
)
\ No newline at end of file
superlists/urls.py
View file @
2638ba33
...
@@ -13,9 +13,12 @@ Including another URLconf
...
@@ -13,9 +13,12 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
"""
from
django.conf.urls
import
url
#superlists/urls.py
from
django.conf.urls
import
include
,
url
from
django.contrib
import
admin
from
django.contrib
import
admin
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^admin/'
,
admin
.
site
.
urls
),
url
(
r'^admin/'
,
admin
.
site
.
urls
),
url
(
r''
,
include
(
'heroes.urls'
)),
]
]
willowisp/__pycache__/settings.cpython-38.pyc
View file @
2638ba33
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment