{ "info": { "author": "crccheck", "author_email": "oss@crccheck.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Testing" ], "description": "Django test curl\n================\n\n[![Build Status](https://travis-ci.org/crccheck/django-test-curl.svg?branch=master)](https://travis-ci.org/crccheck/django-test-curl)\n\nWith _Django test curl_, you can take your test cases and immediately try them\nagainst an actual server via the magic of copy-paste!\n\nDjango's [testing tools] come with a great [test client] you can use to\nsimulate requests against views. Against deployed Django projects, if you want\nto do simple requests, you would probably use [curl]. If you want to use the\nsame syntax for both, this is the package for you.\n\n### Good places to use this\n\nThis was developed to TDD recreating an existing API in Django. If you have a\nlibrary of [curl] requests that you need to replicate, this is perfect for\nthat. If you need a portable format to turn test cases into QA automation, this\nis great for that too.\n\n### Bad places to use this\n\nIf the `.curl(...)` syntax requires lots of string formatting, you should stick\nto the traditional [test client]. If the test case isn't copy-pastable, it's\nnot a good fit. This also means if you use randomness to generate your\nrequests, you'll lose that extra test coverage.\n\n\nInstallation\n------------\n\n```sh\n$ pip install django-test-curl\n```\n\n\nUsage\n-----\n\n```python\nfrom django_test_curl import CurlClient\n\nclass SimpleTest(TestCase):\n \"\"\"https://docs.djangoproject.com/en/stable/topics/testing/tools/#example\"\"\"\n def setUp(self):\n self.client = CurlClient()\n\n def test_details(self):\n response = self.client.curl(\"\"\"\n curl http://localhost:8000/customer/details/\n \"\"\")\n\n self.assertEqual(response.status_code, 200)\n\n self.assertEqual(len(response.context['customers']), 5)\n```\n\nIf you're using a custom `Client`, you can use the mixin version:\n\n```python\nfrom django.test import Client\nfrom django_test_curl import CurlClientMixin\n\nclass MyClient(CurlClientMixin, Client):\n ...\n```\n\nWe support a subset of curl's functionality. For a full list and examples, see\nthe [tests](./django_test_curl/test_django_test_curl.py).\n\n* Headers\n* GET/POST/PUT/DELETE/etc\n* HTTP basic auth\n\n\n[curl]: https://curl.haxx.se/\n[test client]: https://docs.djangoproject.com/en/stable/topics/testing/tools/#the-test-client\n[testing tools]: https://docs.djangoproject.com/en/stable/topics/testing/tools/\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/crccheck/django-test-curl", "keywords": "django,curl,tests", "license": "Apache-2.0", "maintainer": "crccheck", "maintainer_email": "oss@crccheck.com", "name": "django-test-curl", "package_url": "https://pypi.org/project/django-test-curl/", "platform": "", "project_url": "https://pypi.org/project/django-test-curl/", "project_urls": { "Homepage": "https://github.com/crccheck/django-test-curl", "Repository": "https://github.com/crccheck/django-test-curl" }, "release_url": "https://pypi.org/project/django-test-curl/0.1.2/", "requires_dist": null, "requires_python": ">=3.5,<4.0", "summary": "Write Django test requests using curl syntax", "version": "0.1.2" }, "last_serial": 4710655, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ada4893755f2e9a015f48e2037538693", "sha256": "0129d4b39c68bf7a6e5c99bd5b2e71c6ad8dac370c37a5f0b3e50aea6cdb44cf" }, "downloads": -1, "filename": "django_test_curl-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ada4893755f2e9a015f48e2037538693", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 17817, "upload_time": "2018-10-27T23:10:47", "url": "https://files.pythonhosted.org/packages/34/83/2e52f473ed6fa1dbe323fa2464b4e3372addd5ddaf35ecddfc141fdf7335/django_test_curl-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f07f823183a54403444288b950d86630", "sha256": "6c7a60aa1aa34e62b652670e99ec02f1c3843ba9fb4fa0edd66a2587e3d32708" }, "downloads": -1, "filename": "django-test-curl-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f07f823183a54403444288b950d86630", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 7411, "upload_time": "2018-10-27T23:10:46", "url": "https://files.pythonhosted.org/packages/30/11/574bbf4be66e54a63f1d782d4c36793d2f8f7eff8f1552b5fa24629c7a7d/django-test-curl-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1ab86962f2f64fa370c607ee195eb6a0", "sha256": "3cf986aa14ec3e084414712ffc60981f3a22d9fdf7f6fc71270ccba352bd9ec1" }, "downloads": -1, "filename": "django_test_curl-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1ab86962f2f64fa370c607ee195eb6a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 18153, "upload_time": "2018-10-28T04:11:53", "url": "https://files.pythonhosted.org/packages/73/27/cd5b3297a3f0c7c0d8a318cffb024a7d0978243b4143e59bf3193829909b/django_test_curl-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a93b3300ce50ea5575c5a26e4c500b79", "sha256": "86a5c6eb7fa7c3812468bb41157eb37c470de0cc58c5ec03c8508ef968f25c3d" }, "downloads": -1, "filename": "django-test-curl-0.1.1.tar.gz", "has_sig": false, "md5_digest": "a93b3300ce50ea5575c5a26e4c500b79", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 7541, "upload_time": "2018-10-28T04:11:52", "url": "https://files.pythonhosted.org/packages/f1/e8/40921fc4689c2881f5d38f3f5f38e4044f2e3a78db8a07e2ad56bc909153/django-test-curl-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "9ff681e123b27e067a41e3bb5d075706", "sha256": "f240e88e325e8626fe5135ddd1100d9c185441d19540278701c591f2336c7da0" }, "downloads": -1, "filename": "django_test_curl-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9ff681e123b27e067a41e3bb5d075706", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 18807, "upload_time": "2019-01-18T03:40:13", "url": "https://files.pythonhosted.org/packages/0a/67/2cff395024620d750bdfdece16c717fb7686481d78ccf56e59a782c1b0a8/django_test_curl-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7470911a6d6c20ed519f883afab1defe", "sha256": "753688fc79b2e1c0afb9c510ffcd102010e262bbaa86aefe4b30912a18099202" }, "downloads": -1, "filename": "django-test-curl-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7470911a6d6c20ed519f883afab1defe", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 7622, "upload_time": "2019-01-18T03:40:11", "url": "https://files.pythonhosted.org/packages/17/4e/137e5c2118138452e9c1530ee66fa984c84bc5c75c787f05e183c2e90b04/django-test-curl-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9ff681e123b27e067a41e3bb5d075706", "sha256": "f240e88e325e8626fe5135ddd1100d9c185441d19540278701c591f2336c7da0" }, "downloads": -1, "filename": "django_test_curl-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9ff681e123b27e067a41e3bb5d075706", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 18807, "upload_time": "2019-01-18T03:40:13", "url": "https://files.pythonhosted.org/packages/0a/67/2cff395024620d750bdfdece16c717fb7686481d78ccf56e59a782c1b0a8/django_test_curl-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7470911a6d6c20ed519f883afab1defe", "sha256": "753688fc79b2e1c0afb9c510ffcd102010e262bbaa86aefe4b30912a18099202" }, "downloads": -1, "filename": "django-test-curl-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7470911a6d6c20ed519f883afab1defe", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 7622, "upload_time": "2019-01-18T03:40:11", "url": "https://files.pythonhosted.org/packages/17/4e/137e5c2118138452e9c1530ee66fa984c84bc5c75c787f05e183c2e90b04/django-test-curl-0.1.2.tar.gz" } ] }