[arch-projects] [archweb] [PATCH 0/2] mirrorlist: Accept GET parameter filters, improve tests
Hello, please find the following patches. One fixes a bug I noticed where the filter URLs generated by the [mirrorlist] form were not filtering as they should. While fixing this bug, I also improved (I hope!) the testing in the area. Let me know if I'm missing anything. I ran all the test cases, and they still pass. On that note, thanks for making the testing setup very easy to use. It is great to see. [mirrorlist]: https://www.archlinux.org/mirrorlist/ Genki Sky (2): mirrorlist: Accept GET parameters as filters mirrorlist: Complete /all/https success test case mirrors/tests/__init__.py | 11 ++++++----- mirrors/tests/test_mirrorlist.py | 30 +++++++++++++++++++++++------- mirrors/views/mirrorlist.py | 3 ++- 3 files changed, 31 insertions(+), 13 deletions(-) -- 2.17.0
This fixes a regression. Originally request.REQUEST was used, but django
1.9 removed this. In its stead, request.POST was used unconditionally.
However, this results in any GET request returning *all* mirrors, rather
than filtering as requested in the parameters.
This patch uses POST or GET based on the request method. This fixes the
behavior of the [mirror-filter-form], and any scripts depending on the
generated URL format. Accordingly, make test_mirrorlist_filter() test
both the success and failure cases, rather than just success.
[mirror-filter-form]: https://www.archlinux.org/mirrorlist/
Signed-off-by: Genki Sky
Also, remove test_generate(), as it was testing no more than
test_mirrorlist_filter() already was.
Signed-off-by: Genki Sky
participants (1)
-
Genki Sky