Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
490bc2d3
Unverified
Commit
490bc2d3
authored
Feb 07, 2017
by
David Haynes
Browse files
Establish framework for test_views.py
- bunch of blanks for now
parent
99da0008
Pipeline
#850
passed with stage
in 1 minute and 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
go/go/test_views.py
View file @
490bc2d3
...
@@ -17,3 +17,69 @@ class IndexTest(TestCase):
...
@@ -17,3 +17,69 @@ class IndexTest(TestCase):
"""
"""
def
test_Django_Test
(
self
):
def
test_Django_Test
(
self
):
self
.
assertEqual
(
"Hello World!"
,
"Hello World!"
)
self
.
assertEqual
(
"Hello World!"
,
"Hello World!"
)
"""
Test cases for the "view" view
"""
class
ViewTest
(
TestCase
):
"""
Default test case, does not actually test anything
"""
def
test_Django_Test
(
self
):
self
.
assertEqual
(
"Hello World!"
,
"Hello World!"
)
"""
Test cases for the my_links view
"""
class
MyLinksTest
(
TestCase
):
"""
Default test case, does not actually test anything
"""
def
test_Django_Test
(
self
):
self
.
assertEqual
(
"Hello World!"
,
"Hello World!"
)
"""
Test cases for the delete view
"""
class
DeleteTest
(
TestCase
):
"""
Default test case, does not actually test anything
"""
def
test_Django_Test
(
self
):
self
.
assertEqual
(
"Hello World!"
,
"Hello World!"
)
"""
Test cases for the signup view
"""
class
SignupTest
(
TestCase
):
"""
Default test case, does not actually test anything
"""
def
test_Django_Test
(
self
):
self
.
assertEqual
(
"Hello World!"
,
"Hello World!"
)
"""
Test cases for the redirection view
"""
class
RedirectionTest
(
TestCase
):
"""
Default test case, does not actually test anything
"""
def
test_Django_Test
(
self
):
self
.
assertEqual
(
"Hello World!"
,
"Hello World!"
)
"""
Test cases for the useradmin view
"""
class
UserAdminTest
(
TestCase
):
"""
Default test case, does not actually test anything
"""
def
test_Django_Test
(
self
):
self
.
assertEqual
(
"Hello World!"
,
"Hello World!"
)
go/go/views.py
View file @
490bc2d3
...
@@ -59,7 +59,6 @@ def index(request):
...
@@ -59,7 +59,6 @@ def index(request):
@
ratelimit
(
key
=
'user'
,
rate
=
'3/m'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'3/m'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'25/d'
,
method
=
'POST'
,
block
=
True
)
@
ratelimit
(
key
=
'user'
,
rate
=
'25/d'
,
method
=
'POST'
,
block
=
True
)
def
post
(
request
):
def
post
(
request
):
# Now we initialize the form again but this time we have the POST
# Now we initialize the form again but this time we have the POST
# request
# request
url_form
=
URLForm
(
request
.
POST
,
host
=
request
.
META
.
get
(
'HTTP_HOST'
))
url_form
=
URLForm
(
request
.
POST
,
host
=
request
.
META
.
get
(
'HTTP_HOST'
))
...
@@ -158,7 +157,6 @@ def my_links(request):
...
@@ -158,7 +157,6 @@ def my_links(request):
},
},
)
)
"""
"""
This view deletes a URL if you have the permission to. User must be
This view deletes a URL if you have the permission to. User must be
logged in and registered, and must also be the owner of the URL.
logged in and registered, and must also be the owner of the URL.
...
...
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