1. Melevir
  2. django-smoke-admin

Commits

melevir  committed 94ed7c4

Basic settings for publishing

  • Participants
  • Parent commits f9d1b93
  • Branches master

Comments (0)

Files changed (14)

File .gitignore

View file
+.idea/*
+.tox/*
 *.ropeproject*
 *.pyc
 *~

File LICENSE.txt

View file
+Copyright (c) 2012 Lebedev Ilya
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

File MANIFEST

View file
+# file GENERATED by distutils, do NOT edit
+LICENSE.txt
+README.rst
+setup.py
+django-smoke-admin/runtests.py

File MANIFEST.in

View file
+recursive-include djang-smoke-admin/ *
+include *.txt
+include *.rst

File django-smoke-admin/__init__.py

Empty file removed.

File django-smoke-admin/management/__init__.py

View file
+__author__ = 'melevir'

File django-smoke-admin/management/commands/__init__.py

View file
+__author__ = 'melevir'

File django-smoke-admin/management/commands/smoke_admin_test.py

View file
+from django.core.management.base import BaseCommand
+import runtests
+
+class Command(BaseCommand):
+
+    def handle(self, *args, **options):
+        runtests()

File django-smoke-admin/runtests.py

View file
     parser.add_options(NoseTestSuiteRunner.options)
     (options, args) = parser.parse_args()
 
-    runtests(*args, **options.__dict__)
+    runtests(*args, **options.__dict__)
+
+
+if __name__ == '__main__':
+    runtests()

File django-smoke-admin/tests/__init__.py

Empty file added.

File django-smoke-admin/tests/test_smoke_admin.py

View file
         self.assertEqual(response.status_code, 200)
 
 
-
 class SmokeAdminModelSpecificPagesTest(SmokeAdminTest):
     """Smoke tests for admin pages for all registered models"""
 
     def test_changelist_pages_avalible(self):
         """List pages of all registered models responds correctly"""
         for model in self.registered_models:
-            response = self.client.get(reverse('admin:%s_%s_changelist'%(model._meta.app_label, model._meta.module_name)))
-            self.assertEqual(response.status_code, 200)
+            yield self.assertModelsChangelistAvalible, model
+        self.assertEqual(1, 2)
+
+    def assertModelsChangelistAvalible(self, model):
+        print model
+        response = self.client.get(reverse('admin:%s_%s_changelist'%(model._meta.app_label, model._meta.module_name)))
+        self.assertEqual(response.status_code, 2000)
 
     def test_add_pages_avalible(self):
         """Add pages of all registered models responds correctly"""

File setup.py

View file
+from sys import path
+import os
+#from setuptools import setup
+from distutils.core import setup
+
+README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
+
+# allow setup.py to be run from any path
+os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
+
+setup(
+    name = 'django-smoke-admin',
+    version = '0.1',
+    packages = ['django-smoke-admin'],
+    include_package_data = True,
+    license = 'MIT License',
+    description = 'django-smoke-admin tests that all admin pages for all registered models responds correctly (HTTP 200).',
+    long_description = README,
+    url = 'https://bitbucket.org/Melevir/django-smoke-admin',
+    author = 'Lebedev Ilya',
+    author_email = 'melevir@gmail.com',
+    classifiers = [
+        'Environment :: Web Environment',
+        'Framework :: Django',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: MIT License',
+        'Operating System :: OS Independent',
+        'Programming Language :: Python',
+        'Programming Language :: Python :: 2.6',
+        'Programming Language :: Python :: 2.7',
+        'Topic :: Internet :: WWW/HTTP',
+        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
+        ],
+)

File tests/__init__.py

View file
+__author__ = 'melevir'

File tox.ini

View file
+[testenv]
+downloadcache = {toxworkdir}/_download/
+setenv =
+    DJANGO_SETTINGS_MODULE = test_app.test_settings
+commands =
+    python ./django-smoke-admin/runtests.py
+
+[deps]
+base =
+    django-dynamic-fixture==1.6.3
+    django-nose==1.1
+    pinocchio==0.3.1
+
+[testenv:py27-1.4.X]
+basepython = python2.7
+deps =
+    {[deps]base}
+    django==1.4