Merge branch 'heinzel' of python/django-deploy into master
All checks were successful
buildbot/tox Build done.
All checks were successful
buildbot/tox Build done.
This commit was merged in pull request #4.
This commit is contained in:
2
LICENSE
Normal file
2
LICENSE
Normal file
@@ -0,0 +1,2 @@
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted.
|
||||
29
README.rst
29
README.rst
@@ -1,19 +1,36 @@
|
||||
ABOUT
|
||||
=====
|
||||
This is a helper to deploy django apps.
|
||||
This is a helper to deploy reusable django apps
|
||||
into a django project.
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
============
|
||||
See INSTALL.rst
|
||||
- python >= 2.7
|
||||
- Django
|
||||
(will be pulled in by pip, if you haven't installed it already.
|
||||
Probably this is why you are interested in this project)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
============
|
||||
See INSTALL.rst
|
||||
``pip install .``
|
||||
|
||||
|
||||
LICENCE
|
||||
USAGE
|
||||
=====
|
||||
``django-deploy.py --help``
|
||||
|
||||
|
||||
DEVELOPMENT
|
||||
===========
|
||||
For running the test suite, you will need tox
|
||||
(or pytest and mock).
|
||||
|
||||
Running the test suite:
|
||||
``tox``
|
||||
|
||||
|
||||
LICENSE
|
||||
=======
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted.
|
||||
See LICENSE
|
||||
|
||||
28
setup.py
28
setup.py
@@ -1,12 +1,18 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import os
|
||||
import sys
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools import Command
|
||||
|
||||
|
||||
def long_description():
|
||||
path = os.path.abspath(os.path.dirname(__file__))
|
||||
file = os.path.join(path, 'README.rst')
|
||||
with open(file) as f:
|
||||
return f.read()
|
||||
|
||||
|
||||
class MyCommand(Command):
|
||||
user_options = []
|
||||
|
||||
@@ -62,10 +68,22 @@ class CreatePythonEnvironment(MyCommand):
|
||||
setup(
|
||||
name='django-deploy',
|
||||
version='0.2.dev0',
|
||||
description='Helper to deploy django apps.',
|
||||
description='A helper to deploy reusable django apps into a django project.',
|
||||
long_description=long_description(),
|
||||
long_description_content_type='text/x-rst',
|
||||
url='https://dev.heinzelwerk.de/git/python/django-deploy',
|
||||
maintainer='Jens Kleineheismann',
|
||||
maintainer_email='heinzel@farbemachtstark.de',
|
||||
author='Jens Kleineheismann',
|
||||
author_email='heinzel@farbemachtstark.de',
|
||||
classifiers=[
|
||||
'Development Status :: 3 - Alpha',
|
||||
'Environment :: Console',
|
||||
'Framework :: Django',
|
||||
'Intended Audience :: Developers',
|
||||
'Intended Audience :: System Administrators',
|
||||
'License :: Public Domain',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
],
|
||||
cmdclass={
|
||||
'python': CreatePythonEnvironment,
|
||||
},
|
||||
@@ -77,8 +95,8 @@ setup(
|
||||
'django-deploy.py = django_deploy:main',
|
||||
],
|
||||
},
|
||||
python_requires='>=2.7',
|
||||
install_requires=[
|
||||
'django',
|
||||
'mock',
|
||||
],
|
||||
)
|
||||
|
||||
@@ -143,6 +143,7 @@ class DjangoProjectTestCase(DjangoDeployTestCase):
|
||||
'django_deploy.tests.fake_app2',
|
||||
]
|
||||
self.assert_installed_apps(project_dir, installed_apps)
|
||||
self.assert_urlpatterns(project_dir, [])
|
||||
|
||||
def test_install_nonexisting_app(self):
|
||||
project_dir = self._tmp_dir
|
||||
@@ -191,6 +192,12 @@ class DjangoProjectTestCase(DjangoDeployTestCase):
|
||||
]
|
||||
self.assert_urlpatterns(project_dir, expected_urlpatterns)
|
||||
|
||||
installed_apps = [
|
||||
'django_deploy.tests.fake_app1',
|
||||
'django_deploy.tests.fake_app2',
|
||||
]
|
||||
self.assert_installed_apps(project_dir, installed_apps)
|
||||
|
||||
def test_mount_unmountable_app(self):
|
||||
project_dir = self._tmp_dir
|
||||
project = DjangoProject(project_dir)
|
||||
|
||||
@@ -78,12 +78,14 @@ class ProgramTestCase(DjangoDeployTestCase):
|
||||
exitval = self._program(argv=argv)
|
||||
self.assertEqual(os.EX_OK, exitval)
|
||||
|
||||
# Similar code from test_api.test_install_apps
|
||||
installed_apps = [
|
||||
'django_deploy.tests.fake_app1',
|
||||
'django_deploy.tests.fake_app2',
|
||||
]
|
||||
|
||||
self.assert_installed_apps(project_dir, installed_apps)
|
||||
self.assert_urlpatterns(project_dir, [])
|
||||
|
||||
def test_install_apps_with_error(self):
|
||||
project_dir = self._tmp_dir
|
||||
@@ -116,11 +118,21 @@ class ProgramTestCase(DjangoDeployTestCase):
|
||||
exitval = self._program(argv=argv)
|
||||
self.assertEqual(os.EX_OK, exitval)
|
||||
|
||||
urlpatterns = [
|
||||
# Similar code from test_api.test_mount_apps
|
||||
expected_urlpatterns = [
|
||||
('URLResolver', '^app1/', 'django_deploy.tests.fake_app1.urls'),
|
||||
('URLResolver', '^app2/', 'django_deploy.tests.fake_app2.urls'),
|
||||
]
|
||||
self.assert_urlpatterns(project_dir, urlpatterns)
|
||||
|
||||
self.assert_urlpatterns(project_dir, expected_urlpatterns)
|
||||
|
||||
# Similar code from test_api.test_mount_apps
|
||||
installed_apps = [
|
||||
'django_deploy.tests.fake_app1',
|
||||
'django_deploy.tests.fake_app2',
|
||||
]
|
||||
|
||||
self.assert_installed_apps(project_dir, installed_apps)
|
||||
|
||||
def test_mount_apps_with_errors(self):
|
||||
project_dir = self._tmp_dir
|
||||
@@ -134,8 +146,10 @@ class ProgramTestCase(DjangoDeployTestCase):
|
||||
exitval = self._program(argv=argv)
|
||||
self.assertNotEqual(os.EX_OK, exitval)
|
||||
|
||||
patterns = [
|
||||
# Similar code from test_api.test_mount_apps
|
||||
expected_urlpatterns = [
|
||||
('URLResolver', '^app1/', 'django_deploy.tests.fake_app1.urls'),
|
||||
('URLResolver', '^app2/', 'django_deploy.tests.fake_app2.urls'),
|
||||
]
|
||||
self.assert_urlpatterns(project_dir, patterns)
|
||||
|
||||
self.assert_urlpatterns(project_dir, expected_urlpatterns)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
SECRET_KEY = 'test_settings'
|
||||
INSTALLED_APPS = [
|
||||
'django_deploy.tests.fake_app',
|
||||
]
|
||||
Reference in New Issue
Block a user