Table of Contents

Testing

General Testing configurations: https://github.com/edx/edx-platform/blob/master/docs/guides/testing/testing.rst

We start by creating a base configuration which corresponds for the edX common unit tests.  Most other test configurations will be copied and adapted from the base configuration.

Create a debug configuration for an edX common unit test

Create a test configuration for an individual LMS unit test

Create a debug configuration for an individual CMS unit test

Create a debug configuration for an edX acceptance test

Setting up Bokchoy Test Configuration (can't catch breakpoints)

Bokchoy Test Configuration

Setting up Bokchoy Test Configuration for catching break points

See also Working with Vagrant devstack and PyCharm, where there are screenshots of example configurations.

The idea is to start up the LMS and CMS servers with a special configuration (see bleow) and then run tests individually while those services are up.

Note: You may need to set FEATURES['MILESTONES_APP'] and FEATURES['ORGANIZATIONS_APP'] to False in cms/envs/bok_choy.py and lms/envs/bok_choy.py.

1. In Preferences/ Project Structure mark ./common/djangoapps/terrain/stubs as a source.

Troubleshooting

Error: The browser appears to have exited before we could connect.

If you see the following error, either:

See Integrating XQuartz into PyCharm to review instructions on any of the above.

NOTE: You may need to log out and log in to the terminal you opened in the XQuartz integration a second time if PyCharm can't find your display.

BrokenPromise: Promise not satisfied: Browser is instantiated successfully.
-------------------- >> begin captured logging << --------------------
bok_choy.browser: INFO: Using local browser: firefox [Default is firefox]
bok_choy.browser: INFO: Using default firefox profile
bok_choy.browser: DEBUG: Failed to instantiate browser: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

Error: You must link this course to an organization in order to continue.

If you see the following error, you may need to set FEATURES['MILESTONES_APP'] and FEATURES['ORGANIZATIONS_APP'] to False in cms/envs/bok_choy.py and lms/envs/bok_choy.py.

Response content was: {
  "error": "You must link this course to an organization in order to continue. Organization you selected does not exist in the system, you will need to add it to the system"
}