MCPcopy
hub / github.com/django/django / assertLocationCommentPresent

Method assertLocationCommentPresent

tests/i18n/test_extraction.py:105–123  ·  view source on GitHub ↗

r""" self.assertLocationCommentPresent('django.po', 42, 'dirA', 'dirB', 'foo.py') verifies that the django.po file has a gettext-style location comment of the form `#: dirA/dirB/foo.py:42` (or `#: .\dirA\dirB\foo.py:42` on Windows) None can

(self, po_filename, line_number, *comment_parts)

Source from the content-addressed store, hash-verified

103 )
104
105 def assertLocationCommentPresent(self, po_filename, line_number, *comment_parts):
106 r"""
107 self.assertLocationCommentPresent('django.po', 42, 'dirA', 'dirB',
108 'foo.py')
109
110 verifies that the django.po file has a gettext-style location comment
111 of the form
112
113 `#: dirA/dirB/foo.py:42`
114
115 (or `#: .\dirA\dirB\foo.py:42` on Windows)
116
117 None can be passed for the line_number argument to skip checking of
118 the :42 suffix part.
119 A string token can also be passed as line_number, in which case it
120 will be searched in the template, and its line number will be used.
121 A msgid is a suitable candidate.
122 """
123 return self._assertPoLocComment(True, po_filename, line_number, *comment_parts)
124
125 def assertLocationCommentNotPresent(self, po_filename, line_number, *comment_parts):
126 """Check the opposite of assertLocationComment()"""

Calls 1

_assertPoLocCommentMethod · 0.95

Tested by

no test coverage detected