~ubuntu-branches/ubuntu/trusty/horizon/trusty-proposed

« back to all changes in this revision

Viewing changes to horizon/test/helpers.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2013-12-05 14:39:15 UTC
  • mto: This revision was merged to the branch mainline in revision 61.
  • Revision ID: package-import@ubuntu.com-20131205143915-5u8q3kdxdw8e7maz
Tags: upstream-2014.1~b1
ImportĀ upstreamĀ versionĀ 2014.1~b1

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    from selenium.webdriver.firefox.webdriver import WebDriver  # noqa
41
41
    from selenium.webdriver.support import ui as selenium_ui
42
42
except ImportError as e:
43
 
    # NOTE(saschpe): Several distribution can't ship selenium due to it's
 
43
    # NOTE(saschpe): Several distribution can't ship selenium due to its
44
44
    # non-free license. So they have to patch it out of test-requirements.txt
45
45
    # Avoid import failure and force not running selenium tests.
46
46
    LOG.warning("{0}, force WITH_SELENIUM=False".format(str(e)))
75
75
@unittest.skipIf(os.environ.get('SKIP_UNITTESTS', False),
76
76
                     "The SKIP_UNITTESTS env variable is set.")
77
77
class TestCase(django_test.TestCase):
78
 
    """
79
 
    Specialized base test case class for Horizon which gives access to
 
78
    """Specialized base test case class for Horizon which gives access to
80
79
    numerous additional features:
81
80
 
82
81
      * The ``mox`` mocking framework via ``self.mox``.
115
114
            del self.user._perm_cache
116
115
 
117
116
    def assertNoMessages(self, response=None):
118
 
        """
119
 
        Asserts that no messages have been attached by the ``contrib.messages``
120
 
        framework.
 
117
        """Asserts that no messages have been attached by the
 
118
        ``contrib.messages`` framework.
121
119
        """
122
120
        self.assertMessageCount(response, success=0, warn=0, info=0, error=0)
123
121
 
124
122
    def assertMessageCount(self, response=None, **kwargs):
125
 
        """
126
 
        Asserts that the specified number of messages have been attached
 
123
        """Asserts that the specified number of messages have been attached
127
124
        for various message types. Usage would look like
128
125
        ``self.assertMessageCount(success=1)``.
129
126
        """