예제 #1
0
 def test_instance_name_is_used_as_title(self):
     instance = fixtures.get_snippet(name='About page')
     eq_(instance.title, 'About page')
예제 #2
0
 def test_existing_key_is_returned(self):
     snippet = fixtures.get_snippet(
         status=Snippet.PUBLISHED, slug='gigabit')
     eq_(Snippet.published.get_from_key('gigabit'), snippet)
예제 #3
0
 def test_non_featured_article_is_not_returned(self):
     fixtures.get_snippet(status=Snippet.PUBLISHED, is_featured=False)
     eq_(Snippet.published.get_featured(), None)
예제 #4
0
 def test_featured_article_is_returned(self):
     snippet = fixtures.get_snippet(status=Snippet.PUBLISHED, is_featured=True)
     eq_(Snippet.published.get_featured(), snippet)
예제 #5
0
 def test_unpublished_aerticle_is_not_returned(self):
     fixtures.get_snippet(status=Snippet.DRAFT)
     eq_(list(Snippet.published.all()), [])
예제 #6
0
 def test_published_snippet_is_returned(self):
     snippet = fixtures.get_snippet(status=Snippet.PUBLISHED)
     eq_(list(Snippet.published.all()), [snippet])