django-testproject-0.1.2/0000755000175000017500000000000012326243466015230 5ustar neilneil00000000000000django-testproject-0.1.2/setup.cfg0000644000175000017500000000017712326243466017056 0ustar neilneil00000000000000[upload_docs] upload-dir = build/sphinx/html [upload] sign = True [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 django-testproject-0.1.2/django_testproject/0000755000175000017500000000000012326243466021120 5ustar neilneil00000000000000django-testproject-0.1.2/django_testproject/templates/0000755000175000017500000000000012326243466023116 5ustar neilneil00000000000000django-testproject-0.1.2/django_testproject/templates/django_testproject/0000755000175000017500000000000012326243466027006 5ustar neilneil00000000000000django-testproject-0.1.2/django_testproject/templates/django_testproject/base.html0000644000175000017500000000073312243661674030614 0ustar neilneil00000000000000 {% block title %}{% endblock %} {% block content %}{% endblock %} django-testproject-0.1.2/django_testproject/templates/404.html0000644000175000017500000000000012243661674024304 0ustar neilneil00000000000000django-testproject-0.1.2/django_testproject/templates/registration/0000755000175000017500000000000012326243466025630 5ustar neilneil00000000000000django-testproject-0.1.2/django_testproject/templates/registration/login.html0000644000175000017500000000112712243661674027632 0ustar neilneil00000000000000{% extends "registration/base.html" %} {% block title %}{{block.super }} | Sign in {% endblock %} {% block header %} {% if next %}

You need to sign-in to access that page

{% else %}

Sign in

{% endif %} {% endblock %} {% block content %}
{% csrf_token %}

{{ form.username }}

{{ form.password }}

{{ form.errors }}
{% endblock %} django-testproject-0.1.2/django_testproject/templates/registration/base.html0000644000175000017500000000014112243661674027427 0ustar neilneil00000000000000{% extends "django_testproject/base.html" %} {% block title %}Account management{% endblock %} django-testproject-0.1.2/django_testproject/templates/registration/logged_out.html0000644000175000017500000000010312243661674030643 0ustar neilneil00000000000000{% block content %}

You have been signed out

{% endblock %} django-testproject-0.1.2/django_testproject/templates/500.html0000644000175000017500000000000012243661674024301 0ustar neilneil00000000000000django-testproject-0.1.2/django_testproject/__init__.py0000644000175000017500000000000012326241101023177 0ustar neilneil00000000000000django-testproject-0.1.2/django_testproject/settings.py0000644000175000017500000001126512243661674023342 0ustar neilneil00000000000000# Copyright (C) 2010, 2011 Linaro Limited # # Author: Zygmunt Krynicki # # This file is part of django-testproject. # # django-testproject is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation # # django-testproject is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with django-testproject. If not, see . """ Settings generator for test projects """ import inspect import os import sys import django DJANGO_TESTPROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) def _get_default_settings(project_dir): """ Produce default settings """ SECRET_KEY = '' TIME_ZONE = 'Europe/Warsaw' ADMINS = ( #( 'Your name', 'email@example.org'), ) MEDIA_ROOT = '' MEDIA_URL = '' ADMIN_MEDIA_PREFIX = '/media/' LANGUAGE_CODE = 'en-us' USE_I18N = True DEBUG = True TEMPLATE_DEBUG = False MANAGERS = ADMINS ROOT_URLCONF = '' SITE_ID = 1 TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source',) TEMPLATE_DIRS = ( os.path.join(project_dir, "templates"), os.path.join(DJANGO_TESTPROJECT_DIR, "templates")) TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.contrib.messages.context_processors.messages") MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.transaction.TransactionMiddleware',) if django.VERSION[0:2] >= (1, 2): DATABASES = { 'default': { # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'ENGINE': 'django.db.backends.sqlite3', # Or path to database file if using sqlite3. 'NAME': os.path.join(project_dir, 'test.db'), 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. }} else: DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = os.path.join(project_dir, 'test.db') DATABASE_USER = '' DATABASE_PASSWORD = '' DATABASE_HOST = '' DATABASE_PORT = '' return locals() def gen_settings(**kwargs): """ Generate settings for test project The settings will work for django 1.1.x and 1.2.x You may provide any additional settings with keyword arguments, they will be merged with generated settings. """ # Find project_dir by inspecting caller frame = inspect.currentframe() outer_frames = inspect.getouterframes(frame) caller = outer_frames[1][0] project_dir = os.path.dirname( os.path.abspath( inspect.getsourcefile(caller))) # Default settings settings = _get_default_settings(project_dir) # Merge with user provided defaults for key, value in kwargs.iteritems(): if key not in settings: new_value = value elif isinstance(settings[key], (list, tuple)) and isinstance(value, (list, tuple)): # Merge lists new_value = list(settings[key]) + list(value) elif isinstance(settings[key], (int, float, bool, basestring)) and isinstance(value, (int, float, bool, basestring)): # Overwrite simple types new_value = value else: raise ValueError("Don't know how to merge custom setting %r that already exists in generated settings" % key) settings[key] = new_value # Crude django_coverage integration try: import django_coverage settings['INSTALLED_APPS'].insert(0, 'django_coverage') settings['COVERAGE_REPORT_HTML_OUTPUT_DIR'] = os.getenv("COVERAGE_REPORT_HTML_OUTPUT_DIR") settings['COVERAGE_MODULE_EXCLUDES'] = [] except ImportError: pass # Return settings back to the caller return settings django-testproject-0.1.2/django_testproject/tests.py0000644000175000017500000000465012243661674022644 0ustar neilneil00000000000000# Copyright (C) 2010, 2011 Linaro Limited # # Author: Zygmunt Krynicki # # This file is part of django-testproject. # # django-testproject is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation # # django-testproject is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with django-testproject. If not, see . """ Helper function for running tests via setup.py test """ import os import sys import django def run_tests_for(settings_module_name, test_last_n_apps=-1): """ Helper function that simplifies testing Django applications via setup.py test The idea is to test your application in a small test project. Since not everything in your project is relevant (you don't want to test django.contrib.auth gazillion times just because you use it in your application) run_tests allows you to run just a subset of applications. By default last item in INSTALLED_APPLICATIONS is tested. You can change it by calling run_tests() with different argument. If you really want to test all applications just pass None as test_last_n_apps. """ os.environ['DJANGO_SETTINGS_MODULE'] = settings_module_name from django.conf import settings from django.test.utils import get_runner if test_last_n_apps is None: test_labels = None else: test_labels = settings.INSTALLED_APPS[test_last_n_apps:] if django.VERSION[0:2] <= (1, 1): # Prior to django 1.2 the runner was a plain function runner_fn = get_runner(settings) runner = lambda test_labels: runner_fn(test_labels, verbosity=2, interactive=False) else: # After 1.2 the runner is a class runner_cls = get_runner(settings) runner = runner_cls(verbosity=2, interactive=False).run_tests failures = runner(test_labels) sys.exit(failures) def run_tests(test_last_n_apps=-1): """ Like run_tests_for but assumes that settings_module_name is "test_project.settings" """ return run_tests_for("test_project.settings", test_last_n_apps) django-testproject-0.1.2/PKG-INFO0000644000175000017500000000142412326243466016326 0ustar neilneil00000000000000Metadata-Version: 1.1 Name: django-testproject Version: 0.1.2 Summary: Universal project for running unit tests of Django applications Home-page: https://git.linaro.org/lava/django-testproject.git Author: Linaro Limited Author-email: lava-team@linaro.org License: LGPLv3 Description: UNKNOWN Keywords: django,testing Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Environment :: Web Environment Classifier: Framework :: Django Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Topic :: Software Development :: Testing django-testproject-0.1.2/COPYING0000644000175000017500000001672712243661674016303 0ustar neilneil00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. django-testproject-0.1.2/setup.py0000755000175000017500000000333512326241064016741 0ustar neilneil00000000000000#!/usr/bin/env python # Copyright (C) 2010 Linaro Limited # # Author: Zygmunt Krynicki # # This file is part of django-testproject. # # django-testproject is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation # # django-testproject is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with django-testproject. If not, see . from setuptools import setup setup( name='django-testproject', version="0.1.2", author="Linaro Limited", author_email="lava-team@linaro.org", description="Universal project for running unit tests of Django applications", url='https://git.linaro.org/lava/django-testproject.git', license='LGPLv3', keywords=['django', 'testing'], classifiers=[ "Development Status :: 4 - Beta", 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Testing", ], zip_safe=True, packages=[ 'django_testproject', ], install_requires=[ 'django >= 1.0', ], include_package_data=True, ) django-testproject-0.1.2/django_testproject.egg-info/0000755000175000017500000000000012326243466022612 5ustar neilneil00000000000000django-testproject-0.1.2/django_testproject.egg-info/PKG-INFO0000644000175000017500000000142412326243466023710 0ustar neilneil00000000000000Metadata-Version: 1.1 Name: django-testproject Version: 0.1.2 Summary: Universal project for running unit tests of Django applications Home-page: https://git.linaro.org/lava/django-testproject.git Author: Linaro Limited Author-email: lava-team@linaro.org License: LGPLv3 Description: UNKNOWN Keywords: django,testing Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Environment :: Web Environment Classifier: Framework :: Django Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Topic :: Software Development :: Testing django-testproject-0.1.2/django_testproject.egg-info/SOURCES.txt0000644000175000017500000000123712326243466024501 0ustar neilneil00000000000000COPYING MANIFEST.in setup.cfg setup.py django_testproject/__init__.py django_testproject/settings.py django_testproject/tests.py django_testproject.egg-info/PKG-INFO django_testproject.egg-info/SOURCES.txt django_testproject.egg-info/dependency_links.txt django_testproject.egg-info/requires.txt django_testproject.egg-info/top_level.txt django_testproject.egg-info/zip-safe django_testproject/templates/404.html django_testproject/templates/500.html django_testproject/templates/django_testproject/base.html django_testproject/templates/registration/base.html django_testproject/templates/registration/logged_out.html django_testproject/templates/registration/login.htmldjango-testproject-0.1.2/django_testproject.egg-info/top_level.txt0000644000175000017500000000002312326243466025337 0ustar neilneil00000000000000django_testproject django-testproject-0.1.2/django_testproject.egg-info/dependency_links.txt0000644000175000017500000000000112326243466026660 0ustar neilneil00000000000000 django-testproject-0.1.2/django_testproject.egg-info/zip-safe0000644000175000017500000000000112326243324024233 0ustar neilneil00000000000000 django-testproject-0.1.2/django_testproject.egg-info/requires.txt0000644000175000017500000000001512326243466025206 0ustar neilneil00000000000000django >= 1.0django-testproject-0.1.2/MANIFEST.in0000644000175000017500000000010712243661674016767 0ustar neilneil00000000000000include COPYING recursive-include django_testproject/templates *.html