def test_create_post_and_get_id_method_given_valid_details_returns_post_id(create_users ): user_id = 1 post_content = "Post Content" storage = StorageImplementation() post_id = storage.create_post(user_id=user_id, post_content=post_content) post = Post.objects.get(id=post_id) assert post_id == post.id
def test_create_post_with_valid_details_returns_post_id(create_users): # Arrange user_id = 1 post_content = 'Post content' storage = StorageImplementation() # Act post_id = storage.create_post(user_id=user_id, post_content=post_content) # Assert post = Post.objects.get(id=post_id) assert post_id == post.id