safe check for env var

This commit is contained in:
Steve Waterworth
2019-03-04 12:52:55 +00:00
parent e380b3c505
commit e397725db7

View File

@@ -63,7 +63,7 @@ class UserBehavior(TaskSet):
@task
def error(self):
if os.environ['ERROR'] == '1':
if os.environ.get('ERROR') == '1':
print('Error request')
cart = {'total': 0, 'tax': 0}
self.client.post('/api/payment/pay/partner-57', json=cart)