tortoise-orm
tortoise-orm copied to clipboard
add test for accessing a query
This is the first attempt to reproduce issue #780 with a test case
Pull Request Test Coverage Report for Build 1554372017
- 0 of 0 changed or added relevant lines in 0 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 91.763%
| Totals | |
|---|---|
| Change from base Build 1547330232: | 0.0% |
| Covered Lines: | 4821 |
| Relevant Lines: | 5148 |
💛 - Coveralls
@long2ice I have a mistake in the test case
self.assertEqual(await query.all(), [team_2])
should be
self.assertEqual(await query.all(), [event_2])
but all the tests are green. Is the testcase not executed in ci?
What's the result in local?
I can't run the test locally since I am on a windows machine and the instructions in the readme won't work. But here I start the query:
query = Event.filter(pk__in=sub_query_team_1)
and you see it should yield an Event instance, not a Team instance since I filter on the Events. So this should definitely fail:
self.assertEqual(await query.all(), [team_2])
Try merge develop first
Try merge develop first
I'm sorry I don't understand. Should I merge the PR into the Tortoise branch "develop"? Should I merge the Tortoise branch "develop" into my branch and rebase?
Yes, rebase develop to your develop branch
Like this?
@long2ice After pulling the latest develop changes locally I could run the tests locally, too. That helped a lot. Thank you!
The test now fails as expected since the query changes which it should not (bug). This is good to be merged.
@long2ice do I still have to do something so this can get merged?
Yes, just make ci pass
Yes, just make ci pass
It won't pass because it's a bug in tortoise-orm and I don't know how to fix the bug. This just adds a test case so someone else with more knowledge can fix it. See issue #780 for details.
Can we get this merged?
@long2ice : I added some comments - could you merge this?
@abondar Could you merge this please?