{ "info": { "author": "Flavia Missi", "author_email": "flaviamissi@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Testing" ], "description": "#Django Extreme TDD\n\n[![Build Status](https://drone.io/github.com/flaviamissi/django-extreme-tdd/status.png)](https://drone.io/github.com/flaviamissi/django-extreme-tdd/latest)\n\nDjango is an amazing framework to build websites, but it lacks the tools to aid a really important part of the\nsoftware development process: Test Driven Development.\n\n##Django already supports testing, why this project?\n\nDjango has a list of test cases classes to use, and supports running tests much better than it used to,\nbut still, if you want to write a functional test that access the database, and you also want to leave\nthe database cleaning process to Django, the default TestCase class will take care of all that for you. But\nnot without a cost.\n\nFor the TDD process of writing tests, the cost added by the default TestCase is too high\nto bare. Django's TestCase wraps every single test on a suite with a transaction, so every test has a clean\nenvironment to be run in.\n\nA clean environment for every test is indeed a good thing to have. If you don't cleanup your DB after your\ntests, you'll endup with impredictable results, which we should avoid as much as we can on a testing environment.\n\nThe transaction wrapping solution that Django uses for cleanup is not good enough because it's **very** slow.\nYou can see it with your own eyes, use this steps to reproduce:\n\n - write a test that uses the database, do no cleanup by yourself and inherit from django.test.TestCase\n - run only the new test and write down the time spent (Django gives the time taken for the test to run without\n taking into account DB initial setup, you can use this value)\n - change your TestCase class from Django to unittest.TestCase.\n - perform all cleanup needed (consider using setUpClass/tearDownClass here and use'em if you can)\n - run the modified test again and compare the time spent before and after using unittest.TestCase\n\nTODO: actually perform the above steps and show results (results must be reproducible)\n\nYou now know why we need a better cleanup solution.\n\n##Why don't we do the cleanup on our own TestCase implementation?\n\nOne could simply extend unittest.TestCase and add an attribute to keep all objects\nthat were added on a test case and remove then manually, one by one, right?\n\nYes, this is one way to fix the problem, but if you really think about it, will that be much faster\nthan what Django's TestCase does? Maybe. If it is considerably faster, you may find yourself with\nyour database dirty anyways. This solution won't care for deleting objects in cascade, it will only\nwork if the object you created have an FK to another object, but if the opposite is true, you will not\nbe able to do the cleanup properly.\n\nWe could still improving this imaginary solution and eventually make it work, but I don't think it's worth the\neffort. Why?\n\n##Leave database cleanup to the database\n\nAnd that's why. Whatever we try to do programatically, the database can do way better with its own functionality.\nThis is the idea behing the TestCase implemented in this project.\n\nextreme.TestCase is designed to perform cleanup at setUpClass/tearDownClass. This means that a test case inheriting\nfrom extreme.TestCase will have a whole clean database for it to use.\n\nBut it also means that we don't cover cleanup for each single test. But it doesn't mean that we can't extend it.\nIf the need to cleanup before/after every test on a test case exists, extend extreme.TestCase and open a Pull Request!\nJust call the same cleanup method we call on setUpClass/tearDownClass on setUp/tearDown instead! BAHM, problem solved.\n\n##How does it work?\n\nTODO", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/flaviamissi/django-extreme-tdd", "keywords": "testing tdd development django", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-extreme-tdd", "package_url": "https://pypi.org/project/django-extreme-tdd/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-extreme-tdd/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/flaviamissi/django-extreme-tdd" }, "release_url": "https://pypi.org/project/django-extreme-tdd/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Testing toolkit to advocate real and fast TDD (testing first!) in Django applications, eXtremeProgramming like!", "version": "0.1.0" }, "last_serial": 1511466, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ef036589912ae0881b891339797a56ea", "sha256": "c67b6c45eacb0e0ae5995efa5ec70fad5b7c6002434443e324078805846db8b3" }, "downloads": -1, "filename": "django_extreme_tdd-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "ef036589912ae0881b891339797a56ea", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6882, "upload_time": "2015-04-19T14:09:54", "url": "https://files.pythonhosted.org/packages/78/1e/c3efb98be4a89e90ccba7f6dc06270c927595128da0cc8e5df5b98b12e14/django_extreme_tdd-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "936c0c092047bd2faa8aebc47e5039f0", "sha256": "d3c43950d78bcf4adf7fb62090920654248595e59e38479e4e3dabb2033f28c5" }, "downloads": -1, "filename": "django-extreme-tdd-0.1.0.tar.gz", "has_sig": false, "md5_digest": "936c0c092047bd2faa8aebc47e5039f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4075, "upload_time": "2015-04-19T14:09:50", "url": "https://files.pythonhosted.org/packages/66/03/05b43c45e2ba6d6f0034a49509efb60486d496c00e9e01d89945dd902004/django-extreme-tdd-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ef036589912ae0881b891339797a56ea", "sha256": "c67b6c45eacb0e0ae5995efa5ec70fad5b7c6002434443e324078805846db8b3" }, "downloads": -1, "filename": "django_extreme_tdd-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "ef036589912ae0881b891339797a56ea", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6882, "upload_time": "2015-04-19T14:09:54", "url": "https://files.pythonhosted.org/packages/78/1e/c3efb98be4a89e90ccba7f6dc06270c927595128da0cc8e5df5b98b12e14/django_extreme_tdd-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "936c0c092047bd2faa8aebc47e5039f0", "sha256": "d3c43950d78bcf4adf7fb62090920654248595e59e38479e4e3dabb2033f28c5" }, "downloads": -1, "filename": "django-extreme-tdd-0.1.0.tar.gz", "has_sig": false, "md5_digest": "936c0c092047bd2faa8aebc47e5039f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4075, "upload_time": "2015-04-19T14:09:50", "url": "https://files.pythonhosted.org/packages/66/03/05b43c45e2ba6d6f0034a49509efb60486d496c00e9e01d89945dd902004/django-extreme-tdd-0.1.0.tar.gz" } ] }