Fix issue #6833
Finish what was started in 53abda36
Add a test case for #6833. Refs #7130.
Don't include pip in the resulting packages if a prefix is being used, not the right one. Refs #6833, #7130.
Adapt mocked tests to the changes in #6833
Merge pull request #7143 from s0undt3ch/hotfix/pip-tests

Adapt and fix the changes from #6833