Tests for refactoring of get_current_profile and such