openedx / openedx/openedx-platform

Test: Tests break when pycountries updates its list of countries

Open
#37,611 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue testing
Dominant language
Python
Stars
8.2k
Forks
4.4k
Avg merge
6d 18h
Merged PRs (30d)
42

Description

Everytime pycountries updates the list of countries, edx-platform tests fail because we have a copy of the list from that library as a set of test constants: https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_api/tests/test_constants.py

This is super brittle and it's unclear what value it's providing. Do we need these tests? What are they doing? Can we test what we care about in a less brittle way?

Investigate the tests that use the SORTED_COUNTRIES constant and where it's used and see if we can get rid of it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with openedx/core/djangoapps/user_api/tests/test_constants.py and search the repository for uses of SORTED_COUNTRIES. Read the tests that depend on this constant to determine what behavior they actually verify. Done means removing or replacing the brittle copied country list while preserving the behavior those tests need and preventing failures when pycountries updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.