{ "info": { "author": "Jason Christa", "author_email": "jason@zeitcode.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "License :: OSI Approved :: BSD License", "Programming Language :: Python" ], "description": "Django Test Helper\n==================\n\nDjango Test Helper provides some utility functions when testing Django applications\n\nInstallation\n------------\n\nRun `pip install django-test-helper`\n\nHelpers\n-------\n\n###authenticated_client\nA context that provides a Django test Client instance with an authenticated user. It takes a username and a password as arguments.\n\n```python\nfrom django.test import TestCase\nfrom test_helper.utils import authenticated_user\nfrom django.core.urlresolvers import reverse\n\nclass MyTest(TestCase):\n def test_protected_view(self):\n with autenticated_user('username', 'pass') as client:\n response = client.get(reverse('protected_view')\n self.assertEqual(response.status, 200)\n```\n\n###image_file\nCreates on-the-fly an image and returns it. It takes a size tuple and a color rgb tuple.\n\n```python\nfrom django.test import TestCase\nfrom test_helper.utils import image_file\n\nclass MyTest(TestCase):\n def test_form(self):\n data = {\n 'first_name': 'John',\n 'last_name': 'Smith',\n }\n image = image_file(size=(100, 100),\n color=(128, 128, 128))\n files = {\n 'avatar': image,\n }\n form = ProfileForm(data, files)\n self.assertTrue(form.is_valid())\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/nextscreenlabs/django-test-helper", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-test-helper", "package_url": "https://pypi.org/project/django-test-helper/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-test-helper/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/nextscreenlabs/django-test-helper" }, "release_url": "https://pypi.org/project/django-test-helper/0.1a2/", "requires_dist": null, "requires_python": null, "summary": "Utilites for Django tests.", "version": "0.1a2" }, "last_serial": 790857, "releases": { "0.1a2": [ { "comment_text": "", "digests": { "md5": "f5ede457aef17879f1e3a77ac199b816", "sha256": "cf2426d3cc47d66ade4a8f514170b4b95cf3eb00a358dba04a63b97428ae9e7e" }, "downloads": -1, "filename": "django-test-helper-0.1a2.zip", "has_sig": false, "md5_digest": "f5ede457aef17879f1e3a77ac199b816", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6761, "upload_time": "2012-11-02T21:24:09", "url": "https://files.pythonhosted.org/packages/a8/0b/c7ed2db7ff109ed51fe35b486891933d386930cba22f49dda4e1c2f9521d/django-test-helper-0.1a2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f5ede457aef17879f1e3a77ac199b816", "sha256": "cf2426d3cc47d66ade4a8f514170b4b95cf3eb00a358dba04a63b97428ae9e7e" }, "downloads": -1, "filename": "django-test-helper-0.1a2.zip", "has_sig": false, "md5_digest": "f5ede457aef17879f1e3a77ac199b816", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6761, "upload_time": "2012-11-02T21:24:09", "url": "https://files.pythonhosted.org/packages/a8/0b/c7ed2db7ff109ed51fe35b486891933d386930cba22f49dda4e1c2f9521d/django-test-helper-0.1a2.zip" } ] }