Example #1
0
 def test_create_post(self, verify_id_token):
     """Checks to create a post properly."""
     # insert user then create post
     response = self.ping_to_create_post(user=mock_user_1)
     post = Post.objects().first()
     self.assertEqual(response.status_code, 200)
     self.assertEqual(post["title"], "mock_title")
     self.assertEqual(post["description"], "hello world")
     self.assertRegex(post["url"], "https://storage.googleapis.com/.*")
Example #2
0
 def test_post_page(self):
     params = dict(id__lt="60218f0c11062b81bd9e28ca")
     posts = Post.objects(**params).order_by('-id').limit(20).all()