  
  
  #above testcases need to probably moved to the core
  from djangorestframework.compat import RequestFactory
  
  class TestRotation(TestCase):
      """For the example the maximum amount of Blogposts is capped off at views.MAX_POSTS. 
      Whenever a new Blogpost is posted the oldest one should be popped."""
 
</s> remove     """For the example the maximum amount of Blogposts is capped off at 10. 
 </s> add     """For the example the maximum amount of Blogposts is capped off at views.MAX_POSTS.  </s> remove         
 </s> add         models.BlogPost.objects.all().delete()
 </s> remove import os, tempfile, shutil, time, json
 </s> add import tempfile, shutil, json
 </s> remove             response = view(request)
        self.assertEquals(len(models.BlogPost.objects.all()),10)
 </s> add             view(request)
        self.assertEquals(len(models.BlogPost.objects.all()),views.MAX_POSTS)
        
    def test_fifo_behaviour(self):
        '''It's fine that the Blogposts are capped off at MAX_POSTS. But we want to make sure we see FIFO behaviour.'''
        for post in range(15):
            form_data = {'title': '%s' % post, 'content': 'This is the content of post #%s' % post}
            request = self.factory.post('/blog-post', data=form_data)
            view = views.BlogPosts.as_view()
            view(request)
        request = self.factory.get('/blog-post')    
        view = views.BlogPosts.as_view()
        response = view(request)
        response_posts = json.loads(response.content)
        response_titles = [d['title'] for d in response_posts]
        self.assertEquals(response_titles, ['%s' % i for i in range(views.MAX_POSTS - 5, views.MAX_POSTS + 5)]) </s> remove from djangorestframework.response import Response
from djangorestframework.resource import Resource
 </s> add 
import json
  
  
  #above testcases need to probably moved to the core
  from djangorestframework.compat import RequestFactory
import json
  
  class TestRotation(TestCase):
      """For the example the maximum amount of Blogposts is capped off at views.MAX_POSTS. 
      Whenever a new Blogpost is posted the oldest one should be popped."""
keep keep keep add keep keep keep keep
 Refactoring and added another test for blog-posts. Finally got eclipse setup properly with virtualenvs (code analysis). Also I think  I get Bitbuckets workflow now. 
examples/blogpost/tests.py