Ejemplo n.º 1
0
 def test_comment_on_blog_post(self):
     annoying_test = not self.test_settings['ignore_annoying_tests']
     if self.test_settings['oauth'] and annoying_test:
         working_blog_post = BlogPost(50163)
         comment_body = "And this is where I work on making comments on stories from the api :) <3"
         self.auth_zach.comment_on_blog_post(working_blog_post,
                                             comment_body)
Ejemplo n.º 2
0
 def test_empty_photos(self):
     """ Not all stories have photos """
     olegs_first_blog_post_id = 1
     first_blog_post = BlogPost(1)
     self.assertEqual(first_blog_post.user.username, 'oleggutsol')
     self.assertTrue(hasattr(first_blog_post, 'photos'))
     first_blog_post.photos
     self.assertFalse(first_blog_post.photos)
Ejemplo n.º 3
0
 def test_blog_post_comments(self):
     awesome_blog_post_id = 27105
     awesome_blog_post = BlogPost(awesome_blog_post_id)
     actual_body = "Absolutely amazing work. If you need anyone to help carry your gear... feel free to give me a shout! :)"
     self.assertEqual(awesome_blog_post.comments.first().body, actual_body)
Ejemplo n.º 4
0
 def test_photo_extends_properties(self):
     awesome_blog_post_id = 27105
     awesome_blog_post = BlogPost(awesome_blog_post_id)
     freedom_photo_id = 5231155
     self.assertEqual(awesome_blog_post.photos[freedom_photo_id].width,
                      1200)
Ejemplo n.º 5
0
 def test_photos(self):
     awesome_blog_post_id = 27105
     awesome_blog_post = BlogPost(awesome_blog_post_id)
     freedom_photo_id = 5231155
     self.assertTrue(awesome_blog_post.photos)
     self.assertIn(freedom_photo_id, awesome_blog_post.photos)
Ejemplo n.º 6
0
 def test_user(self):
     olegs_first_blog_post_id = 1
     first_blog_post = BlogPost(1)
     self.assertEqual(first_blog_post.user.username, 'oleggutsol')
Ejemplo n.º 7
0
 def test_init(self):
     olegs_first_blog_post_id = 1
     first_blog_post = BlogPost(1)
     self.assertEqual(first_blog_post.id, 1)