Checks the type of value to be string, and that content is as passed in the expected_value argument. This can be either a string, or a compiled regular expression object.
(self, value, expected_value=None, regexp=False)
| 65 | datetime.datetime.strptime(value, DATETIME_FORMAT) |
| 66 | |
| 67 | def assertString(self, value, expected_value=None, regexp=False): |
| 68 | """ |
| 69 | Checks the type of value to be string, and that content is as passed in |
| 70 | the expected_value argument. This can be either a string, or a compiled |
| 71 | regular expression object. |
| 72 | """ |
| 73 | |
| 74 | self.assertType(value, STRING_TYPE) |
| 75 | |
| 76 | if expected_value is not None: |
| 77 | if regexp: |
| 78 | # Match to pattern if checking with regexp |
| 79 | self.assertRegex(value, expected_value) |
| 80 | else: |
| 81 | # Equality match if checking with string |
| 82 | self.assertEqual(value, expected_value) |
| 83 | |
| 84 | def assertNumeric(self, value, expected_value=None): |
| 85 | """ |
no test coverage detected