Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ParsePy
Overview
Overview
Details
Activity
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
OpenEdx
ParsePy
Commits
205a4af1
Commit
205a4af1
authored
Apr 10, 2012
by
David Robinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mention increment method in README and added test case for ParseObject.delete().
parent
248b7569
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
README.mkd
+6
-0
tests.py
+11
-0
No files found.
README.mkd
View file @
205a4af1
...
...
@@ -38,6 +38,12 @@ If we want to make an update, just call save() again after modifying an attribut
>>> gameScore.save()
~~~
~~
You can also increment the score in a single API query:
~~~
~~ {python}
>>> gameScore.increment("score")
~~~
~~
Now that we've done all that work creating our first Parse object, let's delete it:
~~~
~~ {python}
...
...
tests.py
View file @
205a4af1
...
...
@@ -128,6 +128,17 @@ class TestParseObjectAndQuery(unittest.TestCase):
self
.
assertEqual
(
comment2
.
parent
.
objectId
(),
post_id
)
self
.
assertEqual
(
comment2
.
parent
.
title
,
"I'm Hungry"
)
def
test_delete
(
self
):
"""Test deleting an object"""
o
=
test_obj
(
True
)
obj_id
=
o
.
objectId
()
self
.
check_test_obj
(
o
)
o2
=
ParsePy
.
ParseQuery
(
"GameScore"
)
.
get
(
obj_id
)
self
.
check_test_obj
(
o2
)
o2
.
delete
()
self
.
assertRaises
(
urllib2
.
HTTPError
,
ParsePy
.
ParseQuery
(
"GameScore"
)
.
get
,
obj_id
)
if
__name__
==
"__main__"
:
# command line
...
...
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