Closed jsolum closed 2 years ago
I am using pytest and trying to use the tp fixture, but I am running into this error on certain methods: AttributeError: 'TestCase' object has no attribute 'assertTrue'.
tp
AttributeError: 'TestCase' object has no attribute 'assertTrue'
Here is my trace:
def test_thing(tp): response = tp.get('test-url') > tp.assertInContext("foo") test-project/test-app/tests/my_test.py:11: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <test_plus.plugin.TestCase object at 0x107a9ab80>, key = 'requests' def assertInContext(self, key): if self.last_response is not None: > self.assertTrue(key in self.last_response.context) E AttributeError: 'TestCase' object has no attribute 'assertTrue' .venv/lib/python3.8/site-packages/test_plus/test.py:324: AttributeError =========================================================================== short test summary info =========================================================================== FAILED test-project/test-app/tests/my_test.py::test_thing - AttributeError: 'TestCase' object has no attribute 'assertTrue'
Not every method runs into this issue. For example assertLoginRequired works.
assertLoginRequired
Thank you for reporting the issue. This should be fixed in #178
I am using pytest and trying to use the
tp
fixture, but I am running into this error on certain methods:AttributeError: 'TestCase' object has no attribute 'assertTrue'
.Here is my trace:
Not every method runs into this issue. For example
assertLoginRequired
works.