def canned_package(root, version=b'0.3.2'):
    name = 'FooBar'
    root.makedirs()
    setup_py = root.child('setup.py')
    setup_py.setContent(
        dedent("""
        from setuptools import setup

        setup(
            name="{package_name}",
            version="{package_version}",
            py_modules=["{package_name}"],
        )
        """).format(package_name=name, package_version=version)
    )
    package_module = root.child(name + ".py")
    package_module.setContent(
        dedent("""
        __version__ = "{package_version}"
        """).format(package_version=version)
    )

    return PythonPackage(name=name, version=version)
Makes sure the given 'model' is joined in the query. If 'model' isn't
dataset/ETHPy150Open ClusterHQ/flocker/admin/test/test_packaging.py/canned_package--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/sql/query.py/Query.join_parent_model