Exemple #1
0
def delete_banner():
    existing_banner = redis_store.hgetall(BANNER_REDIS_KEY)
    if not existing_banner:
        raise NotFoundError(error_message='No banner currently set.')

    successful_delete = redis_store.delete(BANNER_REDIS_KEY) == 1
    if successful_delete:
        user_seen_keys = redis_store.keys('USER_BANNER_*')
        for key in user_seen_keys:
            redis_store.delete(key)
    return successful_delete
Exemple #2
0
 def teardown_method(self, method):
     with app.test_client() as tc:
         keys_to_delete = redis_store.keys('USER_BANNER_*')
         for k in keys_to_delete:
             redis_store.delete(k)
Exemple #3
0
 def teardown_method(self, method):
     with app.test_client() as tc:
         redis_store.delete(BANNER_REDIS_KEY)