MDL-40536 tests: Add unit tests for import_course

Basic import operations and a specifict test case which identifies
a bug.
MDL-40536 course/externallib fix incorrect variable

Fixes test_import_course_invalid_deletecontent_option() from the
previous commit.