示例#1
0
 def test(self):
     """Testing escapespaces filter"""
     self.assertEqual(djblets_utils.escapespaces('Hi there'), 'Hi there')
     self.assertEqual(djblets_utils.escapespaces('Hi  there'),
                      'Hi  there')
     self.assertEqual(djblets_utils.escapespaces('Hi  there\n'),
                      'Hi&nbsp; there<br />')
示例#2
0
文件: tests.py 项目: dekoza/djblets
 def test(self):
     """Testing escapespaces filter"""
     self.assertEqual(djblets_utils.escapespaces('Hi there'),
                      'Hi there')
     self.assertEqual(djblets_utils.escapespaces('Hi  there'),
                      'Hi&nbsp; there')
     self.assertEqual(djblets_utils.escapespaces('Hi  there\n'),
                      'Hi&nbsp; there<br />')
示例#3
0
 def test_with_multiple_spaces(self):
     """Testing {{...|escapespaces}} with multiple consecutive spaces"""
     self.assertEqual(escapespaces('Hi  there'), 'Hi&nbsp; there')
示例#4
0
 def test_with_newline(self):
     """Testing {{...|escapespaces}} with newline"""
     self.assertEqual(escapespaces('Hi  there\n'), 'Hi&nbsp; there<br />')
示例#5
0
 def test_with_single_space(self):
     """Testing {{...|escapespaces}} with single space"""
     self.assertEqual(escapespaces('Hi there'), 'Hi there')
示例#6
0
文件: tests.py 项目: buriy/djblets
 def test(self):
     """Testing escapespaces filter"""
     self.assertEqual(djblets_utils.escapespaces("Hi there"), "Hi there")
     self.assertEqual(djblets_utils.escapespaces("Hi  there"), "Hi&nbsp; there")
     self.assertEqual(djblets_utils.escapespaces("Hi  there\n"), "Hi&nbsp; there<br />")
 def test_with_newline(self):
     """Testing {{...|escapespaces}} with newline"""
     self.assertEqual(escapespaces('Hi  there\n'),
                      'Hi&nbsp; there<br />')
 def test_with_multiple_spaces(self):
     """Testing {{...|escapespaces}} with multiple consecutive spaces"""
     self.assertEqual(escapespaces('Hi  there'),
                      'Hi&nbsp; there')
 def test_with_single_space(self):
     """Testing {{...|escapespaces}} with single space"""
     self.assertEqual(escapespaces('Hi there'),
                      'Hi there')