def test_create_project_no_django(tmpfolder, nodjango_admin_mock):
    # Given options with the django extension,
    # but without django-admin being installed,
    opts = dict(project=PROJ_NAME, extensions=[django.Django('django')])

    # when the project is created,
    # then an exception should be raised.
    with pytest.raises(django.DjangoAdminNotInstalled):
        create_project(opts)
def test_create_project_with_django(tmpfolder):
    # Given options with the django extension,
    opts = dict(project=PROJ_NAME, extensions=[django.Django('django')])

    # when the project is created,
    create_project(opts)

    # then django files should exist
    for path in DJANGO_FILES:
        assert path_exists(path)
    # and also overwritable pyscaffold files (with the exact contents)
    tmpfolder.join(PROJ_NAME).join("setup.py").read() == setup_py(opts)