{ "info": { "author": "Omni Digital", "author_email": "dev@omni-digital.co.uk", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "Html assertions\n===============\n\nHtml assertions is a simple django testing mixin that makes it possible to assert that a given block of html contains a tag (optionally with a given class) that also contains the specified textual content.\n\n``pip install django_html_assertions``\n\nUsage\n-----\n\nTo use the new test assertion methods all you need to do is mix the mixin into your test suite. You're then ready to go.\n\n::\n\n from django.test import TestCase\n\n from django_html_assertions.mixins import HTMLContainsMixin\n\n\n TEST_HTML = \"\"\"\n \n \n

Item 1

\n

Item 2

\n

Item 3

\n \n \n \"\"\"\n\n\n class HTMLContainsMixinTestCase(HTMLContainsMixin, TestCase):\n \"\"\"\n Tests the test class mixin\n \"\"\"\n def test_assert_html_tag_contains_valid(self):\n \"\"\"\n The method should not raise an exception\n \"\"\"\n self.assertHTMLTagContains(\n TEST_HTML,\n 'Item 1',\n 'p'\n )\n\n def test_assert_html_tag_contains_valid_with_class(self):\n \"\"\"\n The method should not raise an exception\n \"\"\"\n self.assertHTMLTagContains(\n TEST_HTML,\n 'Item 1',\n 'p',\n tag_class='odd'\n )\n\n def test_assert_html_tag_contains_invalid(self):\n \"\"\"\n The method should raise an exception\n \"\"\"\n with self.assertRaises(AssertionError):\n self.assertHTMLTagContains(\n TEST_HTML,\n 'Item 10',\n 'p'\n )\n\n def test_assert_html_tag_contains_invalid_with_class(self):\n \"\"\"\n The method should not raise an exception\n \"\"\"\n with self.assertRaises(AssertionError):\n self.assertHTMLTagContains(\n TEST_HTML,\n 'Item 1',\n 'p',\n tag_class='even'\n )\n\n def test_assert_html_tag_not_contains_valid(self):\n \"\"\"\n The method should not raise an exception\n \"\"\"\n self.assertHTMLTagNotContains(\n TEST_HTML,\n 'Item 10',\n 'p'\n )\n\n def test_assert_html_tag_not_contains_valid_with_class(self):\n \"\"\"\n The method should not raise an exception\n \"\"\"\n self.assertHTMLTagNotContains(\n TEST_HTML,\n 'Item 1',\n 'p',\n tag_class='even'\n )\n\n def test_assert_html_tag_not_contains_invalid(self):\n \"\"\"\n The method should raise an exception\n \"\"\"\n with self.assertRaises(AssertionError):\n self.assertHTMLTagNotContains(\n TEST_HTML,\n 'Item 1',\n 'p'\n )\n\n def test_assert_html_tag_not_contains_invalid_with_class(self):\n \"\"\"\n The method should not raise an exception\n \"\"\"\n with self.assertRaises(AssertionError):\n self.assertHTMLTagNotContains(\n TEST_HTML,\n 'Item 1',\n 'p',\n tag_class='odd'\n )\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/omni-digital/django_html_assertions/tarball/0.1.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/omni-digital/django_html_assertions/", "keywords": "django", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django_html_assertions", "package_url": "https://pypi.org/project/django_html_assertions/", "platform": "", "project_url": "https://pypi.org/project/django_html_assertions/", "project_urls": { "Download": "https://github.com/omni-digital/django_html_assertions/tarball/0.1.0", "Homepage": "https://github.com/omni-digital/django_html_assertions/" }, "release_url": "https://pypi.org/project/django_html_assertions/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "A simple Django app to add html related assertions to djangos testing classes.", "version": "0.1.0" }, "last_serial": 3831292, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "610d574b8c936ec7df25849132a5941d", "sha256": "62d7393a0109df941fd10cfc5ed90e8bfba9f3fa0ff86e273c1bd0b3d985f823" }, "downloads": -1, "filename": "django_html_assertions-0.1.0.tar.gz", "has_sig": false, "md5_digest": "610d574b8c936ec7df25849132a5941d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3247, "upload_time": "2018-05-03T14:59:51", "url": "https://files.pythonhosted.org/packages/2e/48/3a57f834f7111f6d5d9694c05f3fb708df305eefb186d7c404c4d1f1238f/django_html_assertions-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "610d574b8c936ec7df25849132a5941d", "sha256": "62d7393a0109df941fd10cfc5ed90e8bfba9f3fa0ff86e273c1bd0b3d985f823" }, "downloads": -1, "filename": "django_html_assertions-0.1.0.tar.gz", "has_sig": false, "md5_digest": "610d574b8c936ec7df25849132a5941d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3247, "upload_time": "2018-05-03T14:59:51", "url": "https://files.pythonhosted.org/packages/2e/48/3a57f834f7111f6d5d9694c05f3fb708df305eefb186d7c404c4d1f1238f/django_html_assertions-0.1.0.tar.gz" } ] }