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
bba7e210
Unverified
Commit
bba7e210
authored
Mar 13, 2017
by
David Haynes
Browse files
Test all the clicks fields
- can they all increment?
parent
473c34fd
Pipeline
#1089
passed with stage
in 58 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
go/go/test_models.py
View file @
bba7e210
...
...
@@ -394,13 +394,57 @@ class URLTest(TestCase):
except
DataError
as
ex
:
self
.
assertTrue
(
ex
)
# clicks -------------------------------------------------------------------
def
test_clicks
(
self
):
"""
Test that clicks incremention works
"""
# Get the URL to test
get_user
=
User
.
objects
.
get
(
username
=
'dhaynes'
)
get_registered_user
=
RegisteredUser
.
objects
.
get
(
user
=
get_user
)
current_url
=
URL
.
objects
.
get
(
owner
=
get_registered_user
)
# Increment
current_url
.
clicks
+=
1
;
self
.
assertEqual
(
current_url
.
clicks
,
1
)
# qrclicks -----------------------------------------------------------------
def
test_qrclicks
(
self
):
"""
Test that cliqrclickscks incremention works
"""
# Get the URL to test
get_user
=
User
.
objects
.
get
(
username
=
'dhaynes'
)
get_registered_user
=
RegisteredUser
.
objects
.
get
(
user
=
get_user
)
current_url
=
URL
.
objects
.
get
(
owner
=
get_registered_user
)
# Increment
current_url
.
qrclicks
+=
1
;
self
.
assertEqual
(
current_url
.
qrclicks
,
1
)
# socialclicks -------------------------------------------------------------
def
test_socialclicks
(
self
):
"""
Test that socialclicks incremention works
"""
# Get the URL to test
get_user
=
User
.
objects
.
get
(
username
=
'dhaynes'
)
get_registered_user
=
RegisteredUser
.
objects
.
get
(
user
=
get_user
)
current_url
=
URL
.
objects
.
get
(
owner
=
get_registered_user
)
# Increment
current_url
.
socialclicks
+=
1
;
self
.
assertEqual
(
current_url
.
socialclicks
,
1
)
# expires ------------------------------------------------------------------
# __str__ ------------------------------------------------------------------
...
...
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