def simple_story_dict(user): return { 'title': "Short title for a testing story", 'slug': "short-title-for-testing-story", 'body': "This is a the body of the story.", 'tags': "mobile vikings", 'author': user, 'allow_comments': True, 'site': Config.get_current().site }
def setUp(self): self.kwargs = { 'title': "Short title for a testing story", 'slug': "short-title-for-testing-story", 'body': "This is the content of the story.", 'tags': "mobile vikings", 'author': User.objects.get(username="******"), 'allow_comments': True, 'site': Config.get_current().site } self.tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
def setUp(self): self.kwargs = { "title": "Short title for a testing story", "slug": "short-title-for-testing-story", "body": "This is the content of the story.", "tags": "mobile vikings", "author": User.objects.get(username="******"), "allow_comments": True, "site": Config.get_current().site, } self.tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
def config(request): """ Adds configuration information to the context. To employ, add the conf method reference to your project settings TEMPLATE_CONTEXT_PROCESSORS. Example: TEMPLATE_CONTEXT_PROCESSORS = ( ... "easy_blog.context_processors.config", ) """ return {'easy_blog_config': Config.get_current()}
def config(self): if self._config is None: self._config = Config.get_current() return self._config
def get_paginate_by(self, queryset): # config = Config.get_current() # return config.stories_in_index if config else 5 return Config.get_current().stories_in_index