Refactor, add missing coverage
Merge branch 'master' into Issue1979
[1979] Clean up CoursesDbTest

fixes #1979