diff options
Diffstat (limited to 'examples/blogpost')
| -rw-r--r-- | examples/blogpost/tests.py | 7 | ||||
| -rw-r--r-- | examples/blogpost/views.py | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/examples/blogpost/tests.py b/examples/blogpost/tests.py index d4084e72..494478d8 100644 --- a/examples/blogpost/tests.py +++ b/examples/blogpost/tests.py @@ -1,8 +1,12 @@ """Test a range of REST API usage of the example application. """ +from django.core.urlresolvers import reverse from django.test import TestCase +<<<<<<< local +======= from django.core.urlresolvers import reverse +>>>>>>> other from django.utils import simplejson as json from djangorestframework.compat import RequestFactory @@ -166,7 +170,10 @@ class AllowedMethodsTests(TestCase): #above testcases need to probably moved to the core +<<<<<<< local +======= +>>>>>>> other class TestRotation(TestCase): """For the example the maximum amount of Blogposts is capped off at views.MAX_POSTS. diff --git a/examples/blogpost/views.py b/examples/blogpost/views.py index 59a3fb9f..9e07aa8a 100644 --- a/examples/blogpost/views.py +++ b/examples/blogpost/views.py @@ -8,25 +8,21 @@ MAX_POSTS = 10 class BlogPosts(RootModelResource): """A resource with which lists all existing blog posts and creates new blog posts.""" - anon_allowed_methods = allowed_methods = ('GET', 'POST',) model = models.BlogPost fields = BLOG_POST_FIELDS class BlogPostInstance(ModelResource): """A resource which represents a single blog post.""" - anon_allowed_methods = allowed_methods = ('GET', 'PUT', 'DELETE') model = models.BlogPost fields = BLOG_POST_FIELDS class Comments(RootModelResource): """A resource which lists all existing comments for a given blog post, and creates new blog comments for a given blog post.""" - anon_allowed_methods = allowed_methods = ('GET', 'POST',) model = models.Comment fields = COMMENT_FIELDS class CommentInstance(ModelResource): """A resource which represents a single comment.""" - anon_allowed_methods = allowed_methods = ('GET', 'PUT', 'DELETE') model = models.Comment fields = COMMENT_FIELDS |
