Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1606876052-practice
Commits
ee53307a
Commit
ee53307a
authored
Sep 18, 2019
by
Rayza Arasj Mahardhika
Browse files
Merge branch 'exercise/homepage'
parents
8bc89603
70f0c1f4
Pipeline
#20025
passed with stage
in 2 minutes and 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lists/tests.py
View file @
ee53307a
...
...
@@ -16,7 +16,7 @@ class HomePageTest(TestCase):
html
=
response
.
content
.
decode
(
'utf8'
)
self
.
assertTrue
(
html
.
startswith
(
'<html>'
))
self
.
assertIn
(
'<title>Rayza
\'
s Homepage</title>'
,
html
)
self
.
assertIn
(
'<h1>
W
el
co
me
to
Rayza
\'
s Homepage
</h1>'
,
html
)
self
.
assertIn
(
'<h1>
H
el
lo, my na
me
is
Rayza
Arasj Mahardhika
</h1>'
,
html
)
self
.
assertTrue
(
html
.
endswith
(
'</html>'
))
class
AboutPageTest
(
TestCase
):
...
...
@@ -31,6 +31,8 @@ class AboutPageTest(TestCase):
html
=
response
.
content
.
decode
(
'utf8'
)
self
.
assertTrue
(
html
.
startswith
(
'<html>'
))
self
.
assertIn
(
'<title>Rayza
\'
s About Page</title>'
,
html
)
self
.
assertIn
(
'<h1>He
llo, my name is Rayza Arasj Mahardhika
</h1>'
,
html
)
self
.
assertIn
(
'<h1>He
re
\'
s a few facts about me
</h1>'
,
html
)
self
.
assertIn
(
'<p>I
\'
m 21 years old</p>'
,
html
)
self
.
assertIn
(
'<p>I
\'
m from Bogor</p>'
,
html
)
self
.
assertIn
(
'<p>I
\'
m currently studying Computer Science at Faculty of Computer Science, Universitas Indonesia</p>'
,
html
)
self
.
assertTrue
(
html
.
endswith
(
'</html>'
))
lists/views.py
View file @
ee53307a
...
...
@@ -4,7 +4,7 @@ def home_page(request):
return
HttpResponse
(
'<html>'
+
'<title>Rayza
\'
s Homepage</title>'
+
'<h1>
W
el
co
me
to
Rayza
\'
s Homepage
</h1>'
+
'<h1>
H
el
lo, my na
me
is
Rayza
Arasj Mahardhika
</h1>'
+
'</html>'
)
...
...
@@ -12,7 +12,9 @@ def about_page(request):
return
HttpResponse
(
'<html>'
+
'<title>Rayza
\'
s About Page</title>'
+
'<h1>He
llo, my name is Rayza Arasj Mahardhika
</h1>'
+
'<h1>He
re
\'
s a few facts about me
</h1>'
+
'<p>I
\'
m 21 years old</p>'
+
'<p>I
\'
m from Bogor</p>'
+
'<p>I
\'
m currently studying Computer Science at Faculty of Computer Science, Universitas Indonesia</p>'
+
'</html>'
)
Write
Preview
Supports
Markdown
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