mklymyshyn / django-dtpanel-htmltidy

Custom panel form Django Debug Toolbar which display HTML Validation errors and warnings
BSD 3-Clause "New" or "Revised" License
45 stars 8 forks source link

Corrected the tests for them to work. #2

Closed Narsil closed 13 years ago

Narsil commented 13 years ago

Tests are not functionning because the tests cannot find the htmlvalidator template.

Also more warnings are found than in the previous version

mklymyshyn commented 13 years ago

Hi,

Thank you very much for your efforts!

I have couple notes about your changes:

  1. You forgot to import os module into debug_toolbar_htmltidy/tests/tests.py which caused import errors (use pyflakes)
  2. Why you don't respect PEP8 formatting of entire code?
  3. Tests failed with:
    test_apperance_builder (debug_toolbar_htmltidy.tests.tests.HTMLValidationDebugPanelTestCase) ... FAIL
    test_media (debug_toolbar_htmltidy.tests.tests.HTMLValidationDebugPanelTestCase) ... ok
    test_validator_counters (debug_toolbar_htmltidy.tests.tests.HTMLValidationDebugPanelTestCase) ... FAIL

    ======================================================================
    FAIL: test_apperance_builder (debug_toolbar_htmltidy.tests.tests.HTMLValidationDebugPanelTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/gabonsky/Temp/django-dtpanel-htmltidy/debug_toolbar_htmltidy/tests/tests.py", line 109, in test_apperance_builder
        self.assertEqual(len(builded_errors), 41)
    AssertionError: 8 != 41

    ======================================================================
    FAIL: test_validator_counters (debug_toolbar_htmltidy.tests.tests.HTMLValidationDebugPanelTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/gabonsky/Temp/django-dtpanel-htmltidy/debug_toolbar_htmltidy/tests/tests.py", line 96, in test_validator_counters
        self.assertEqual(panel.warns_count, 38)
    AssertionError: 6 != 38

It's easy to reproduce:

  1. Clone your repo into new location
  2. Create new virtual environment and activate it
  3. Execute python setup.py test

If you have time, please fix it and update your pull request. I will be glad to merge it to mainstream.

Narsil commented 13 years ago

Hi thanks for the feedback and the help, I've updated my vim config to have pyflakes and pep8 working properly and automatically now.

The pull request has been updated.

mklymyshyn commented 13 years ago

Thank you, Narsil!