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

Count feature, related test and import optimisation #18

Merged
merged 4 commits into from Jan 25, 2023

Conversation

rkisdp
Copy link
Contributor

@rkisdp rkisdp commented Jul 1, 2022

Hi, @rednaks,

I have added the count feature and test for the same, and with that, I have also changed some other tests accordingly and removed unused imports from the file. Please have a look and give your feedback.

@rkisdp
Copy link
Contributor Author

rkisdp commented Jul 3, 2022

Hi, @rednaks, Can you please review the PR? and please let me know if you think I have made any mistake.

@rednaks
Copy link
Owner

rednaks commented Jul 3, 2022

Thank you, looks good for me, can you just update the README file for the count and none ?

Thanks !

@rkisdp
Copy link
Contributor Author

rkisdp commented Jul 3, 2022

Sure! Can I add some tests for some other features which are active but the test isn't available?

@rkisdp
Copy link
Contributor Author

rkisdp commented Jul 3, 2022

Hi, @rednaks, I have updated the README file and added some tests also. Please review this and let me know if you want me to add something else.

@rkisdp
Copy link
Contributor Author

rkisdp commented Jul 10, 2022

Hi, @rednaks, Can you please review the changes and let me know if you want any more here? I want to contribute more.


await all_created.async_delete()
all_after_delete = await TestModel.objects.async_all()
self.assertEqual(len(all_after_delete), 0)
count = await all_created.async_count()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use all_after_delete rather than all_created

qs = await qs.async_first()
self.assertEqual(qs.name, "setup 2")

await test_async_order_by_ascending(self)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be better to split then into two different tests, always one assert per unit test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have divided this into 2 different tests. Thanks for your advice, I'm trying to learn the best coding practices from developers like you.

self.assertEqual(result.name, 'test')

@tag('ci')
async def test_async_bulk_create(self):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove this test ?! we need to test async_bulk_create !!

README.md Outdated
@@ -130,8 +132,6 @@ You can still call `Model.object.async_raw()` but you will be unable to access t
| methods | supported | comments |
|----------------------------|------------|----------|
| `Model.async_save` | ❌ | |
| `Model.async_update` | ❌ | |
| `Model.async_delete` | ❌ | |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove this ?


@tag('dev')
async def test_async_bulk_update(self):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?!

@rednaks
Copy link
Owner

rednaks commented Jul 12, 2022

Thank you for your PR, but I don't know why you removed so many tests ... please revert them and make the changes requested in the comments.

Thank you

@rkisdp
Copy link
Contributor Author

rkisdp commented Jul 12, 2022

Hi, @rednaks, thanks for your valuable feedback. I have changed the test file according to your comments but there is no change in the readme file. Both the features are available in the module that's why I removed them from the readme file. Thanks again for your valuable feedback.

@rednaks rednaks self-requested a review July 16, 2022 09:04
@rkisdp
Copy link
Contributor Author

rkisdp commented Jul 24, 2022

Hi, @rednaks did you check this? any feedback?

@rednaks rednaks merged commit b33a2e7 into rednaks:main Jan 25, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants