old_contents: import pytest
  
  from flask import json, url_for
  
  
  class WhenAccessingSiteInfo(object):
  
      def it_shows_info(self, client, db):
          response = client.get(
              url_for('.get_info')
          )
          query = 'SELECT version_num FROM alembic_version'
          version_from_db = db.session.execute(query).fetchone()[0]
          json_resp = json.loads(response.get_data(as_text=True))['info']
          assert response.status_code == 200
          assert json_resp == version_from_db
  
new_contents: import pytest
  
  from flask import json, url_for
  
  
  class WhenAccessingSiteInfo(object):
  
      def it_shows_info(self, client, db):
          response = client.get(
              url_for('.get_info')
          )
          query = 'SELECT version_num FROM alembic_version'
          version_from_db = db.session.execute(query).fetchone()[0]
          json_resp = json.loads(response.get_data(as_text=True))['info']
          assert response.status_code == 200
          assert json_resp == version_from_db
  
      def it_shows_db_error(self, mocker, client, db):
          mocker.patch('app.rest.db.session.execute', side_effect=Exception('db error'))
          response = client.get(
              url_for('.get_info')
          )
          json_resp = json.loads(response.get_data(as_text=True))['info']
          assert response.status_code == 200
          assert json_resp == 'Database error, check logs'
  
subject: Add test for info when db error