معرفی شرکت ها


django_html_assertions-0.1.0


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

A simple Django app to add html related assertions to djangos testing classes.
ویژگی مقدار
سیستم عامل -
نام فایل django_html_assertions-0.1.0
نام django_html_assertions
نسخه کتابخانه 0.1.0
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Omni Digital
ایمیل نویسنده dev@omni-digital.co.uk
آدرس صفحه اصلی https://github.com/omni-digital/django_html_assertions/
آدرس اینترنتی https://pypi.org/project/django_html_assertions/
مجوز MIT
Html assertions =============== Html 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. ``pip install django_html_assertions`` Usage ----- To 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. :: from django.test import TestCase from django_html_assertions.mixins import HTMLContainsMixin TEST_HTML = """ <html> <body> <p class="odd">Item 1</p> <p class="even">Item 2</p> <p class="odd">Item 3</p> </body> </html> """ class HTMLContainsMixinTestCase(HTMLContainsMixin, TestCase): """ Tests the test class mixin """ def test_assert_html_tag_contains_valid(self): """ The method should not raise an exception """ self.assertHTMLTagContains( TEST_HTML, 'Item 1', 'p' ) def test_assert_html_tag_contains_valid_with_class(self): """ The method should not raise an exception """ self.assertHTMLTagContains( TEST_HTML, 'Item 1', 'p', tag_class='odd' ) def test_assert_html_tag_contains_invalid(self): """ The method should raise an exception """ with self.assertRaises(AssertionError): self.assertHTMLTagContains( TEST_HTML, 'Item 10', 'p' ) def test_assert_html_tag_contains_invalid_with_class(self): """ The method should not raise an exception """ with self.assertRaises(AssertionError): self.assertHTMLTagContains( TEST_HTML, 'Item 1', 'p', tag_class='even' ) def test_assert_html_tag_not_contains_valid(self): """ The method should not raise an exception """ self.assertHTMLTagNotContains( TEST_HTML, 'Item 10', 'p' ) def test_assert_html_tag_not_contains_valid_with_class(self): """ The method should not raise an exception """ self.assertHTMLTagNotContains( TEST_HTML, 'Item 1', 'p', tag_class='even' ) def test_assert_html_tag_not_contains_invalid(self): """ The method should raise an exception """ with self.assertRaises(AssertionError): self.assertHTMLTagNotContains( TEST_HTML, 'Item 1', 'p' ) def test_assert_html_tag_not_contains_invalid_with_class(self): """ The method should not raise an exception """ with self.assertRaises(AssertionError): self.assertHTMLTagNotContains( TEST_HTML, 'Item 1', 'p', tag_class='odd' )


نحوه نصب


نصب پکیج whl django_html_assertions-0.1.0:

    pip install django_html_assertions-0.1.0.whl


نصب پکیج tar.gz django_html_assertions-0.1.0:

    pip install django_html_assertions-0.1.0.tar.gz