Skip to content

Commit

Permalink
Merge pull request ckan#7982 from JVickery-TBS/feature/test-response-…
Browse files Browse the repository at this point in the history
…class-bytes-property

Test Response Class Bytes Property
  • Loading branch information
wardi authored Dec 14, 2023
2 parents bd02018 + b420bb1 commit d3f12c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/7982.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `bytes` property to the test CKANResponse class which returns bytes from the response data.
4 changes: 4 additions & 0 deletions ckan/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ class CKANResponse(Response):
def body(self):
return self.get_data(as_text=True)

@property
def bytes(self):
return self.get_data(as_text=False)

def __contains__(self, segment):
return segment in self.body

Expand Down

0 comments on commit d3f12c3

Please sign in to comment.