Fakultas Ilmu Komputer UI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
1
1506689074-practice
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PMPL
Collection of Practice
2019
1506689074-practice
Commits
cc3fd6f5
Commit
cc3fd6f5
authored
5 years ago
by
Alvin Raihan
Browse files
Options
Downloads
Patches
Plain Diff
ch3
parent
97adecfe
No related branches found
No related tags found
1 merge request
!1
Homepage
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
virtualenv/lists/tests.py
+15
-3
15 additions, 3 deletions
virtualenv/lists/tests.py
virtualenv/lists/views.py
+3
-3
3 additions, 3 deletions
virtualenv/lists/views.py
with
18 additions
and
6 deletions
virtualenv/lists/tests.py
+
15
−
3
View file @
cc3fd6f5
from
django.urls
import
resolve
from
django.urls
import
resolve
from
django.test
import
TestCase
from
django.test
import
TestCase
from
lists.views
import
home_page
from
django.http
import
HttpRequest
from
lists.views
import
home_page
class
HomePageTest
(
TestCase
):
class
HomePageTest
(
TestCase
):
def
test_root_url_resolves_to_home_page_view
(
self
):
def
test_root_url_resolves_to_home_page_view
(
self
):
found
=
resolve
(
'
/
'
)
found
=
resolve
(
'
/
'
)
self
.
assertEqual
(
found
.
func
,
home_page
)
self
.
assertEqual
(
found
.
func
,
home_page
)
\ No newline at end of file
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>
'
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
virtualenv/lists/views.py
+
3
−
3
View file @
cc3fd6f5
from
django.
shortcuts
import
render
from
django.
http
import
HttpResponse
# Create your views here.
# Create your views here.
def
home_page
():
def
home_page
(
request
):
pass
return
HttpResponse
(
'
<html><title>To-Do lists</title></html>
'
)
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment