Commits

Anonymous committed ac76e55

Added testproject skeleton for tests

Comments (0)

Files changed (10)

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

testproject/__init__.py

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

testproject/config.example.py

+
+### 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!'

testproject/config.py

+
+### 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!'

testproject/manage.py

+#!/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)

testproject/settings.py

+# -*- 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"
Add a comment to this file

testproject/template/500.html

Empty file added.

testproject/template/index.html

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

testproject/template/main.html

+<?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>

testproject/urls.py

+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.