{ "info": { "author": "colons", "author_email": "pypi@colons.co", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Topic :: Software Development :: Testing" ], "description": ".. image:: https://colons.co/instant-coverage-small.png\n :alt: A roll of duct tape; the instant coverage logo\n\nInstant Coverage |status|\n=========================\n\n.. |status| image:: https://travis-ci.org/colons/instant-coverage.svg\n :target: https://travis-ci.org/colons/instant-coverage\n\nYour new Django site need tests. Nothing super fancy, just enough that you know\nyou've not forgotten to close some
somewhere and it's not going to start\n500ing next time you deploy. You *could* write unit tests, but those are boring\nand your client sure as hell isn't going to pay for the time.\n\nYou've got five minutes, though.\n\nFeatures\n--------\n\nSimple\n Iterates through a list of URLs and complains if any of them 500.\n\nMagic\n Will loudly complain when there are views missing from the list of URLs to\n test.\n\nHas what you need\n Comes with `optional mixins`_ for checking links and validating HTML, JSON,\n your spelling, or WCAG compliance.\n\nExtensible\n Easily add tests that will run against every view on your website. If you\n want tests for things like consistent capitalisation of a particular phrase\n or the universal inclusion of a particular meta tag, you can have them in\n minutes.\n\nPortable\n Tested_ on Python 2.7, 3.4, 3.5, and 3.6 with Django versions 1.4 to 2.0,\n with `some exclusions`_.\n\n.. _some exclusions: https://github.com/colons/instant-coverage/blob/master/.travis.yml\n.. _tested: https://travis-ci.org/colons/instant-coverage\n\nChanges\n=======\n\nChanges made in each release are listed in tags_ in this repository.\n\n.. _tags: https://github.com/colons/instant-coverage/releases\n\nUsage\n=====\n\nInstall\n-------\n\n``pip install django-instant-coverage``\n\n\u2018Write\u2019 your tests\n------------------\n\nYou'll want a tests module somewhere. I keep mine in my ``PROJECT_DIR``,\nbecause it's testing the whole site and not just one app. Wherever you put it,\nit should be named such that your test runner will find it (``tests.py``\nusually works well) and should contain at least the following:\n\n.. code-block:: python\n\n from django.test import TestCase\n from instant_coverage import InstantCoverageMixin\n\n class EverythingTest(InstantCoverageMixin, TestCase):\n pass\n\nWith that in place, you should be able to run your tests with ``python\nmanage.py test``. They'll fail, though. You'll get a list of URLs you've not\ntold it to test, looking something like this:\n\n::\n\n AssertionError: The following views are untested:\n\n ('^',) ^$ (index)\n ('^admin/',) ^$ (index)\n ('^admin/',) ^logout/$ (logout)\n ('^admin/',) ^password_change/$ (password_change)\n [...]\n\nIt'll probably contain a bunch of URLs you don't want to test, though, like\nthose from the Django admin app. To quickly exclude entire URL includes, add\ntuples like the ones shown in the failure you just got to your test's\n``uncovered_includes`` attribute:\n\n.. code-block:: python\n\n class EverythingTest(InstantCoverageMixin, TestCase):\n uncovered_includes = [\n ('^admin/',),\n ]\n\nAdd paths matching the URLs that you *do* actually want to test to\n``covered_urls``, and add paths that match those you *don't* to\n``uncovered_urls``. If you forget what's still missing, run the tests again to\nget an audit of what's left.\n\n.. code-block:: python\n\n class EverythingTest(InstantCoverageMixin, TestCase):\n covered_urls = [\n '/',\n '/api/',\n '/0007C3F2760E0541/',\n ]\n\n uncovered_urls = [\n # requires stuff to be in the session\n '/upload/confirm/',\n '/shortlist-selection/',\n\n # only accepts POST\n '/shortlist-order/',\n\n # probably tested pretty thoroughly by the django project\n '/media/woof.jpg',\n ]\n\nIf you want to use ``reverse()`` rather than hard-code URLs or if you want to\ntest more than one path for a given URL, that is fully supported. Encouraged_,\neven. It doesn't matter how you build it, as long as ``covered_urls`` is a\nlist.\n\n.. _Encouraged: https://github.com/colons/musicfortheblind.co.uk/blob/master/mftb5/tests.py\n\nIf you have views that you can't test without data present in the database,\n`make a fixtures file`_ and `add it to your test class`_.\n\n.. _make a fixtures file: https://docs.djangoproject.com/en/dev/ref/django-admin/#dumpdata-app-label-app-label-app-label-model\n.. _add it to your test class: https://docs.djangoproject.com/en/dev/topics/testing/tools/#django.test.TransactionTestCase.fixtures\n\nUse the provided optional test mixins\n-------------------------------------\n\nBy default, Instant Coverage will make sure none of your views raise unhandled\nexceptions and all of them return status codes between 200 and 399. There's a\ngood chance at least some of the provided `optional mixins`_ will be\nappropriate for your website, so be sure to have a look through them and see\nwhat strikes your fancy. Use them like this:\n\n.. code-block:: python\n\n from instant_coverage import InstantCoverageMixin, optional\n\n class EverythingTest(\n optional.Spelling, optional.ExternalLinks, optional.ValidHTML5,\n InstantCoverageMixin, TestCase\n ):\n # covered_urls, etc...\n\nWrite your own tests\n--------------------\n\n``InstantCoverageMixin`` provides an ``instant_responses`` method that returns\na dictionary of |responses|_ keyed by URL. Test methods you write should\niterate across that. Have a look at the `optional mixins`_ for some examples.\n\n.. |responses| replace:: Django test client ``Response`` objects\n.. _responses: https://docs.djangoproject.com/en/dev/topics/testing/tools/#django.test.Response\n.. _optional mixins: https://github.com/colons/instant-coverage/blob/master/instant_coverage/optional.py\n\nIf you make any that you think might be useful to any other websites, even if a\nminority, a pull request would be very much appreciated.\n\nTest under different circumstances\n----------------------------------\n\nIf you want to test all the URLs you've listed under different circumstances\n(for instance, when a user is logged in or when a different language has been\nselected), create a subclass of your tests and override ``setUp()``. For\ninstance, you might put the following below your ``EverythingTest``:\n\n.. code-block:: python\n\n from django.contrib.auth import get_user_model\n\n class LoggedInEverythingTest(EverythingTest):\n def setUp(self):\n super(LoggedInEverythingTest, self).setUp()\n user = get_user_model()(\n username='user',\n is_staff=True,\n is_superuser=True,\n )\n user.set_password('pass')\n user.save()\n self.assertTrue(self.client.login(username='user', password='pass'))\n\nBe aware that, by default, the test client will follow redirects. If you do not\nwant this, set the ``follow_redirects`` attribute of your tests to ``False``.\nIf you have more specific requirements, you may have to override the\n``get_client_kwargs`` or ``attempt_to_get_internal_url`` methods of your test.\n\nIf you have a bunch of test classes that test the same collection of URLs, you\nmay want to consider inheriting from ``InstantCoverageAPI`` instead of\n``InstantCoverageMixin``; the former will not run any tests that you don't\nexplicitly add yourself.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/colons/instant-coverage", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-instant-coverage", "package_url": "https://pypi.org/project/django-instant-coverage/", "platform": "any", "project_url": "https://pypi.org/project/django-instant-coverage/", "project_urls": { "Homepage": "https://github.com/colons/instant-coverage" }, "release_url": "https://pypi.org/project/django-instant-coverage/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Better-than-nothing testing for Django", "version": "1.1.0" }, "last_serial": 3648028, "releases": { "0.0.0": [], "0.0.1": [ { "comment_text": "", "digests": { "md5": "6958d35020e500deb6b3fb29c657a38f", "sha256": "ca128f2e458e7164ec71b82240a1fcc7ac176f163bfc65ea71afdd116e814023" }, "downloads": -1, "filename": "django-instant-coverage-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6958d35020e500deb6b3fb29c657a38f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2919, "upload_time": "2014-02-23T15:16:41", "url": "https://files.pythonhosted.org/packages/fc/46/9993c44e22e3cf10b20918951fde23ca3a30b6ec09cf4452b94e0d9fd025/django-instant-coverage-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "a626bca3ab280ecea158632cf52e1c68", "sha256": "7fa61535c43aca17095dd4b929365db2c993be23fa5dbaa7afa7c4fd0bded4db" }, "downloads": -1, "filename": "django-instant-coverage-0.0.10.tar.gz", "has_sig": false, "md5_digest": "a626bca3ab280ecea158632cf52e1c68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8150, "upload_time": "2014-03-06T12:59:50", "url": "https://files.pythonhosted.org/packages/a1/d7/f4b32b2368b73a4892851f7b8feca2923042e191cb2847097cf2e28be421/django-instant-coverage-0.0.10.tar.gz" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "e255d86de3dc71519ae9a198b7fb50d0", "sha256": "f5d040c13b5dd5c5d4767d6366e9b17edbe6db843b7c09a011bdbd40ded56e3a" }, "downloads": -1, "filename": "django-instant-coverage-0.0.11.tar.gz", "has_sig": false, "md5_digest": "e255d86de3dc71519ae9a198b7fb50d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8239, "upload_time": "2014-03-12T15:11:47", "url": "https://files.pythonhosted.org/packages/78/c9/d776b291e243ff5f6327ee7a6c303b62455007464ba46f10d2e8d73609d2/django-instant-coverage-0.0.11.tar.gz" } ], "0.0.12": [ { "comment_text": "", "digests": { "md5": "5d857a1a46d76db2f3576f161d8cc520", "sha256": "6b26fbb22f1a52b753537f7918633e774a6604341b1a676585530526e23c50cf" }, "downloads": -1, "filename": "django-instant-coverage-0.0.12.tar.gz", "has_sig": false, "md5_digest": "5d857a1a46d76db2f3576f161d8cc520", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8726, "upload_time": "2014-09-18T17:18:15", "url": "https://files.pythonhosted.org/packages/c5/77/f40aae8a97f155200cf5abd9f60cbb5dd5d88bd9423b5f1cb1c0c0f080b8/django-instant-coverage-0.0.12.tar.gz" } ], "0.0.13": [ { "comment_text": "", "digests": { "md5": "737e1c84c68e5550e854b096ccb61909", "sha256": "854c0f5cb121268a5c71995f7d7cf74b4558a1923cf35ec548d7f8a7ebd0309c" }, "downloads": -1, "filename": "django-instant-coverage-0.0.13.tar.gz", "has_sig": false, "md5_digest": "737e1c84c68e5550e854b096ccb61909", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8755, "upload_time": "2014-10-31T12:17:45", "url": "https://files.pythonhosted.org/packages/ce/bf/6b516ee079bb9a935823056fc88ef5b7e429c740a1d959b5ecd5e6444813/django-instant-coverage-0.0.13.tar.gz" } ], "0.0.14": [ { "comment_text": "", "digests": { "md5": "a8295b25438f0e01be2999f600249c27", "sha256": "3201c3ef4cbf3ee510c983abc513374bfd575925f371175ede456c270ad3ca6f" }, "downloads": -1, "filename": "django-instant-coverage-0.0.14.tar.gz", "has_sig": false, "md5_digest": "a8295b25438f0e01be2999f600249c27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8902, "upload_time": "2015-04-02T14:26:37", "url": "https://files.pythonhosted.org/packages/b5/ed/3636d01a27b684fdacae8d1059e2efed40944d8d698314180cd34dd65319/django-instant-coverage-0.0.14.tar.gz" } ], "0.0.15": [ { "comment_text": "", "digests": { "md5": "20bc22ccf889f7b1f5be5a4d9e071657", "sha256": "84348ea325b381bf8a386edf816b4f490009c08d4bed667b7b38c92feb49cec5" }, "downloads": -1, "filename": "django-instant-coverage-0.0.15.tar.gz", "has_sig": false, "md5_digest": "20bc22ccf889f7b1f5be5a4d9e071657", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11559, "upload_time": "2015-07-28T10:12:48", "url": "https://files.pythonhosted.org/packages/64/84/20edfd40989ebcce755cf08c2a7083ca5a3828e9acb3155ada8a6c7ccb51/django-instant-coverage-0.0.15.tar.gz" } ], "0.0.16": [ { "comment_text": "", "digests": { "md5": "49e39b1a0509155b15e6b51aafd8fdc9", "sha256": "9060f7054ad82fccf8c1fe6fbee5b4551e716eb54061e79b6882b356defd42a0" }, "downloads": -1, "filename": "django-instant-coverage-0.0.16.tar.gz", "has_sig": false, "md5_digest": "49e39b1a0509155b15e6b51aafd8fdc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9019, "upload_time": "2016-05-06T14:24:34", "url": "https://files.pythonhosted.org/packages/ec/9e/f7fe94d14ef4b7182ac23da392841818c2df4a83b3a6725f1f42354d5259/django-instant-coverage-0.0.16.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "24585178d1273622fbfc2bad4b9d137e", "sha256": "64e1a4d92d9f32b91fede6667787c556b886fd4a9261c7af9e19014c37acd4b7" }, "downloads": -1, "filename": "django-instant-coverage-0.0.4.tar.gz", "has_sig": false, "md5_digest": "24585178d1273622fbfc2bad4b9d137e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6011, "upload_time": "2014-02-23T17:54:27", "url": "https://files.pythonhosted.org/packages/b9/50/8bf454c9d6d72d7e5f29d295da9d8c12a3e4d92c24f0c60e180c6d7fc647/django-instant-coverage-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "dabfa4c99682dd859678b8fa8b9d9528", "sha256": "3e4da43921d33a819838ec018d489398d2b12a26ec7240180560cc40e4c0c4b1" }, "downloads": -1, "filename": "django-instant-coverage-0.0.5.tar.gz", "has_sig": false, "md5_digest": "dabfa4c99682dd859678b8fa8b9d9528", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6546, "upload_time": "2014-02-23T20:47:00", "url": "https://files.pythonhosted.org/packages/23/1f/3090a1cc28bc22b4afbe5f6a21d747ab6029ef6332a562413397e1528576/django-instant-coverage-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "9950d4660e31bb24d55e7d1bf3ac18bf", "sha256": "f665c7387e938073b7885844180443a085eb602c8fc1b22a7b3d2de336d4f132" }, "downloads": -1, "filename": "django-instant-coverage-0.0.6.tar.gz", "has_sig": false, "md5_digest": "9950d4660e31bb24d55e7d1bf3ac18bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6630, "upload_time": "2014-02-23T21:37:19", "url": "https://files.pythonhosted.org/packages/92/0f/2d75908b8956b9231b705df18165c60f6b21dd821b9173289cd8442efb2f/django-instant-coverage-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "28da25a55eb90a650c0321cbf9ae3250", "sha256": "34f0c304190fd7681b028d342e1d2f6be75e9aae1ce52d726456a28b15cfcbe4" }, "downloads": -1, "filename": "django-instant-coverage-0.0.7.tar.gz", "has_sig": false, "md5_digest": "28da25a55eb90a650c0321cbf9ae3250", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6884, "upload_time": "2014-02-26T12:17:14", "url": "https://files.pythonhosted.org/packages/b9/3b/d6d83fc4c0f5212a3281443b5ded084c2eefa1202c551b11264e5e6516b6/django-instant-coverage-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "8feafb01690d575b1c5a601ab41f30d8", "sha256": "2354b6fec9bccdee5599df3eb4d778d4fc6e09bf5c177b232da5bc2411e23211" }, "downloads": -1, "filename": "django-instant-coverage-0.0.8.tar.gz", "has_sig": false, "md5_digest": "8feafb01690d575b1c5a601ab41f30d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7798, "upload_time": "2014-02-26T23:05:13", "url": "https://files.pythonhosted.org/packages/0a/f6/4cde65b7f7508bad8d6b34b268741beaffe8379e2abf54d24bd231da1133/django-instant-coverage-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "6940c393e4118fee40edd958679ce9fa", "sha256": "77e4e95cf0bf0ffa61c6cb802e2d5ed44c233a559e83fcb109fae44524677c8d" }, "downloads": -1, "filename": "django-instant-coverage-0.0.9.tar.gz", "has_sig": false, "md5_digest": "6940c393e4118fee40edd958679ce9fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7983, "upload_time": "2014-02-28T11:26:42", "url": "https://files.pythonhosted.org/packages/53/7f/eb3508ec311692277895d39434e5a3c04dff28e196fc5d1a755b47275c84/django-instant-coverage-0.0.9.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "a6f5a0dc483e0d181adabf1a27a09eae", "sha256": "59f1a6245d7765c8246d37c8c3f8819ed8534c217fee47c79c80df64d2865a9b" }, "downloads": -1, "filename": "django_instant_coverage-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "a6f5a0dc483e0d181adabf1a27a09eae", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 13234, "upload_time": "2017-02-08T15:32:51", "url": "https://files.pythonhosted.org/packages/e6/32/a0662984741c92b574f92e8936724aaf95e32779871856d3c97156b81e96/django_instant_coverage-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f1978cd7e8bf1d773fc385026f6c0cdd", "sha256": "6457804f3fc9ad8daf647ca117357410ead93c3746a51774ba813a64d550599f" }, "downloads": -1, "filename": "django_instant_coverage-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f1978cd7e8bf1d773fc385026f6c0cdd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13234, "upload_time": "2017-02-08T15:30:54", "url": "https://files.pythonhosted.org/packages/49/57/2ac0201a75c6e86a670585f21996fa032a7fe33d4614179f95788305176d/django_instant_coverage-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0811f2babbb2faa4dfb8490ff19f10d", "sha256": "0062b3dc6c8621f4a01e0dae17b151062b622c9e9284ea440dda0ebab48c852a" }, "downloads": -1, "filename": "django-instant-coverage-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a0811f2babbb2faa4dfb8490ff19f10d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8852, "upload_time": "2017-02-08T15:24:54", "url": "https://files.pythonhosted.org/packages/d9/cc/a067905eaf583b900cd5547f522dcfcd9574705d28ad9d7a6961b786f346/django-instant-coverage-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "4c3c459dc923e51b55a243a10197083e", "sha256": "b26aa84c5b2e7a09e5620ccbb9b638ec42b4d79c184fb4887018ac30a828a163" }, "downloads": -1, "filename": "django-instant-coverage-1.1.0.tar.gz", "has_sig": false, "md5_digest": "4c3c459dc923e51b55a243a10197083e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12517, "upload_time": "2018-03-07T14:51:45", "url": "https://files.pythonhosted.org/packages/6d/31/4b03c8e3b3299f8922d4c37b251f76a9a63184a5e1d366e2fe1e674b312a/django-instant-coverage-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4c3c459dc923e51b55a243a10197083e", "sha256": "b26aa84c5b2e7a09e5620ccbb9b638ec42b4d79c184fb4887018ac30a828a163" }, "downloads": -1, "filename": "django-instant-coverage-1.1.0.tar.gz", "has_sig": false, "md5_digest": "4c3c459dc923e51b55a243a10197083e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12517, "upload_time": "2018-03-07T14:51:45", "url": "https://files.pythonhosted.org/packages/6d/31/4b03c8e3b3299f8922d4c37b251f76a9a63184a5e1d366e2fe1e674b312a/django-instant-coverage-1.1.0.tar.gz" } ] }