-
Notifications
You must be signed in to change notification settings - Fork 5
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
📁 Feed: Splitting Tests Into Separated Files #64
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests seem to be included.
Good job on improving the names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Great initiative! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, well done.
feed/tests/test_comment_model.py
Outdated
def test_comment_save_to_db(self, comments): | ||
# Testing comment save in DB | ||
comments[0].save() | ||
assert comments[0] in Comment.comments.all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, the tests should filter the comment in db, and compare it against the returned data from fixtures
Please apply for all the rest of the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Yarboa,
In this case I try to check if the model really got saved in DB, so I believe this is the correct way to do so.
If you're still think that a change is required here, will the change look like the following? :
def test_comment_save_to_db(self, comments):
# Testing comment save in DB
comments[0].save()
comment = Comment.comments.filter(content=COMMENT1_CONTENT).first()
assert comment in Comment.comments.all()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but please compare it with all comments data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im not sure what do you mean by compare to all comments data, do you mean to filter according to all properties and not only to content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the purpose of the test,
If you have a comment, how do you find the logical connections from db, FYI
@paOmer please take a look at previous comments |
feed/tests/test_comment_model.py
Outdated
def test_comment_save_to_db(self, comments): | ||
# Testing comment save in DB | ||
comments[0].save() | ||
assert comments[0] in Comment.comments.all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but please compare it with all comments data
Hi @Yarboa, after you'll review I would squash and force push, as mentioned in the last Beyond session. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR aims to take the existing feed app tests and split them into separated files.
In future sight, many more tests will be added, so to remain organized it is best to split big files into small and logically separated files.
tests.py
filetests
directory inside the feed app root directoryClose #66