'Verifies that the app has been purchased by the user.'

def check_purchase_app(self):

    self.setup_db()
    sql = 'SELECT    type    FROM    addon_purchase\n                                                                    WHERE    addon_id    =    %(app_id)s\n                                                                    AND    uuid    =    %(uuid)s    LIMIT    1;'
    self.cursor.execute(sql, {'app_id': self.get_app_id(), 'uuid': self.get_user()})
    result = self.cursor.fetchone()
    if (not result):
        log_info('Invalid    app    receipt,    no    purchase')
        raise InvalidReceipt('NO_PURCHASE')
    self.check_purchase_type(result[0])
