Adding tests for import_apps and shared duplicated code