def test_400_list_limit_exceeded_error(self):
with mock.patch('resy.user.api.MultipleList') as MultipleListMock:
MultipleListMock.get_user_list_count.return_value = 100
response = self.app.post(
self.path,
headers=self.headers,
content_type='application/json',
data=json.dumps({
'name': 'My Favorite Venues',
})
)
print(response)
def get_user_list_count(self):
user_list_count = tinyAPI.dsh().count(
"""select count(*) from user_venue_list
where (user_id=%(user_id)s or user_id is null) and is_deleted=0
""",
{
'user_id': self.user_id
}
)
return user_list_count
def check_user_list_limit(self) -> None:
if self.get_user_list_count() >= self.list_limit:
raise multiple_list_error.ListLimitExceededError