1. Lukas Linhart
  2. django-http-digest

Commits

almad  committed ac76e55

Added testproject skeleton for tests

  • Participants
  • Parent commits 00b8093
  • Branches default

Comments (0)

Files changed (10)

File run_tests

View file
+#!/bin/sh
+cd testproject
+./manage.py test $1
+exit $?;

File testproject/__init__.py

View file
+"""
+    This is testing project for KeyKeeper application.
+"""

File testproject/config.example.py

View file
+
+### Django settings
+
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+
+ADMINS = (
+     # ('Almad', 'bugs at almad.net'),
+)
+
+URL_ROOT="http://localhost:8000/"
+
+SITE_ID =1
+
+MANAGERS = ADMINS
+
+DATABASE_ENGINE = "sqlite3"
+DATABASE_NAME = "/home/almad/tmp/digest.db"
+DATABASE_USER = ""
+DATABASE_PASSWORD = ""
+DATABASE_HOST = "localhost"
+DATABASE_PORT = ''
+
+#DATABASE_OPTIONS = {"init_command": "SET storage_engine=INNODB" } 
+
+
+TIME_ZONE = 'Europe/Prague'
+
+LANGUAGE_CODE = 'cs'
+FILE_CHARSET = 'utf-8'
+DEFAULT_CHARSET = 'utf-8'
+
+USE_I18N = True
+
+MEDIA_ROOT = "/tmp/"
+MEDIA_URL = "/media/"
+
+ADMIN_MEDIA_PREFIX = "/adminmedia/"
+SECRET_KEY = 'qjgj741513+cjj9lb+46&f3gyvh@0jgou-rx-tqbziw6f$bt59xxx!'

File testproject/config.py

View file
+
+### Django settings
+
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+
+ADMINS = (
+     # ('Almad', 'bugs at almad.net'),
+)
+
+URL_ROOT="http://localhost:8000/"
+
+SITE_ID =1
+
+MANAGERS = ADMINS
+
+DATABASE_ENGINE = "sqlite3"
+DATABASE_NAME = "/tmp/test.db"
+DATABASE_USER = ""
+DATABASE_PASSWORD = ""
+DATABASE_HOST = "localhost"
+DATABASE_PORT = ''
+
+#DATABASE_OPTIONS = {"init_command": "SET storage_engine=INNODB" } 
+
+
+TIME_ZONE = 'Europe/Prague'
+
+LANGUAGE_CODE = 'cs'
+FILE_CHARSET = 'utf-8'
+DEFAULT_CHARSET = 'utf-8'
+
+USE_I18N = True
+
+# we don't really9 need those
+MEDIA_ROOT = "/tmp/"
+MEDIA_URL = "/media/"
+
+ADMIN_MEDIA_PREFIX = "/adminmedia/"
+SECRET_KEY = 'qjgj741513+cjj9lb+46&f3gyvh@0jgou-rx-tqbziw6f$bt59xxx!'

File testproject/manage.py

View file
+#!/usr/bin/env python
+from django.core.management import execute_manager
+try:
+    import settings # Assumed to be in the same directory.
+except ImportError:
+    import sys
+    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+    sys.exit(1)
+
+#also add parent dir to path so django-http-client is it
+import os, os.path, sys
+
+sys.path.insert(0, os.path.join(os.path.abspath(__file__), os.pardir))
+
+if __name__ == "__main__":
+    execute_manager(settings)

File testproject/settings.py

View file
+# -*- coding: utf-8 -*-
+
+from os import path
+
+working_dir = path.dirname(path.abspath(__file__))
+
+from config import *
+
+APPLICATION_ROOT=path.join(path.dirname(path.abspath(__file__)))
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+    'django.template.loaders.filesystem.load_template_source',
+    'django.template.loaders.app_directories.load_template_source',
+    'django.template.loaders.eggs.load_template_source',
+)
+
+# AUTHENTICATION_BACKENDS = ('keykeeper.libopenid.OpenidBackend',)
+
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.middleware.transaction.TransactionMiddleware',
+    'django.middleware.http.SetRemoteAddrFromForwardedFor',
+)
+
+ROOT_URLCONF = 'testproject.urls'
+
+SESSION_SAVE_EVERY_REQUEST = True
+SESSION_COOKIE_NAME = 'testproject_id'
+
+TEMPLATE_DIRS = (
+    path.join(APPLICATION_ROOT, 'template/')
+)
+
+TEMPLATE_CONTEXT_PROCESSORS = (
+    "django.core.context_processors.auth",
+    "django.core.context_processors.media",
+    "django.core.context_processors.request",
+)
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.admin',
+)
+
+TEST_DATABASE_CHARSET="utf8"

File testproject/template/500.html

Empty file added.

File testproject/template/index.html

View file
+{% extends 'main.html' %}
+
+{% block content %}
+<h1>Ttesting project</h1>
+
+<p>Skeleton for testing project</p>
+
+{% endblock %}

File testproject/template/main.html

View file
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+	<meta http-equiv="content-type" content="aplication/xhtml; charset=UTF-8" />
+	<title>Testing project</title>
+<body>
+<div id="content">
+	{% block content %}{% endblock %}
+</div>
+
+</body>
+</html>

File testproject/urls.py

View file
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+)