Ejemplo n.º 1
0
# make sure to use importd from the repository
import os
import sys
from importd import d

d(
    DEBUG=True,
    LOG_LOCATION=d.dotslash(""),
    INSTALLED_APPS=['test_app'],
)

if __name__ == "__main__":
    path_with_py_api = os.path.join(os.path.dirname(os.path.abspath(__file__)), "temp-log.py")
    path_wit_d = d.dotslash("temp-log.py")
    if path_with_py_api == path_wit_d:
        print("Test passed")
    else:
        raise Exception("Test failed")

    d.main()
Ejemplo n.º 2
0
# make sure to use importd from the repository
import os
import sys
from importd import d, s
try:
    d(DEBUG=True,
      LOG_LOCATION=d.dotslash("temp-log.py"),
      DEBUG_TEST=[s("DEBUG")])
except:
    print("test passed")
else:
    raise Exception("test failed")
Ejemplo n.º 3
0
# make sure to use importd from the repository
import os
import sys
from importd import d, s

d(
    DEBUG=True,
    LOG_LOCATION=d.dotslash("temp-log.py"),
    DEBUG_TEST=s("DEBUG"), 
    INSTALLED_APPS=["test_app"],
)

if __name__ == "__main__":
    from django.conf import settings
    assert settings.DEBUG_TEST
    d.main()
Ejemplo n.º 4
0
# make sure to use importd from the repository
import os
import sys
from importd import d

d(
    DEBUG=True,
    LOG_LOCATION=d.dotslash("temp-log.py"),
)

if __name__ == "__main__":
    path_with_py_api = os.path.join(os.path.dirname(os.path.abspath(__file__)), "temp-log.py")
    path_wit_d = d.dotslash("temp-log.py")
    if path_with_py_api == path_wit_d:
        print("Test passed")
    else:
        raise Exception("Test failed")

    d.main()
Ejemplo n.º 5
0
    ),
    HAYSTACK_CONNECTIONS={
        'default': {
            'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
            'PATH': os.path.join(HERE, 'whoosh_index'),
            'TITLE': 'testing',
        },
    },
    admin="^admin/",
)

from django.conf.urls.static import static
from django.conf.urls import include
import debug_toolbar
d.urlpatterns += static(prefix='/m/', show_indexes=True,
                        document_root=d.dotslash('media'))
d.urlpatterns += d.patterns('',
        d.url(r'^debug_toolbar/', include(debug_toolbar.urls)))


if __name__ == "__main__":
    d.do("syncdb", "--noinput")
    from django.contrib.auth.models import User
    admin_user, created = User.objects.get_or_create(username="******",
                                                     is_active=True,
                                                     is_staff=True,
                                                     is_superuser=True)
    admin_user.set_password('admin')
    admin_user.save()
    d.main()
Ejemplo n.º 6
0
# make sure to use importd from the repository
import os
import sys
from importd import d

d(DEBUG=True, LOG_LOCATION=d.dotslash(""), INSTALLED_APPS=["test_app"])

if __name__ == "__main__":
    path_with_py_api = os.path.join(os.path.dirname(os.path.abspath(__file__)), "temp-log.py")
    path_wit_d = d.dotslash("temp-log.py")
    if path_with_py_api == path_wit_d:
        print("Test passed")
    else:
        raise Exception("Test failed")

    d.main()