Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a student I want to be able to filter posts by role #19

Closed
divyaChandran10 opened this issue Jun 23, 2022 · 8 comments
Closed

As a student I want to be able to filter posts by role #19

divyaChandran10 opened this issue Jun 23, 2022 · 8 comments
Assignees

Comments

@divyaChandran10
Copy link
Contributor

divyaChandran10 commented Jun 23, 2022

As a student, I must know the available roles , to filter the posts accordingly

@mathiasbrito-dci
Copy link
Contributor

This story depends on the Post model, so it is important to create it, however, issues #2 #10 and #18 also need it, so it is important to you to sync with the other to find a common solution for the post model.

@divyaChandran10
Copy link
Contributor Author

Since I am depending on #2, I am working on #13 with my pair.

@lamalul
Copy link

lamalul commented Jul 5, 2022

what we have done:
1- updated the models.py by adding the role attribute to the User class.
2- Created the test cases for the Post routes and and Post controller
3-Created the post.py file which included the implementation of the routes and controller related to the issue.
4- updated db.py with load_posts method.
5- updated the main.py to include the routes of the post.
6- pushed the branch Issue_#19 into GitHub.

What we would like to do today:
1- we need to check the test cases for multiple posts:
this test works only for a posts_list with single object:

def test_get_posts_by_student_system_must_show_the_post_posted_by_student_and_return_200_ok(): with patch('class_social.db.load_posts') as mocked_load_posts: mocked_load_posts.return_value = posts_list controller = PostController() result = controller.get_posts_by_creator_role('Student') assert result == posts_list
2- We fixed some Errors in the test files and we need to push them to the branch.
What is hindering us :
We need to reopen the issue #21 and we are waiting for the response of the product owner

@mathiasbrito-dci
Copy link
Contributor

Nice, Lama, and Dyvia, seems that you are doing good progress. Regarding #21, please add the role to the user as an Optional field...

role: Optional[str]

As an optional field at first, it will not break other's code.

@divyaChandran10
Copy link
Contributor Author

Thanks Mathias ! We will add the attribute as an optional for now.

@divyaChandran10
Copy link
Contributor Author

What we have done:

  1. Fixed the issue against multiple posts (Modified the code to check the testcase for multiple posts).
    What we do today:
  2. We need to push the implemented code.

@lamalul
Copy link

lamalul commented Jul 6, 2022

Pull request #29 has been created.

@mathiasbrito-dci
Copy link
Contributor

Good Job Lama and Divya. Closing the issue since it is solved in #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants