text: import pytest, unittest
  from application import app, db
  from application.models import Weapon
  from flask import abort, url_for
  from flask_testing import TestCase
  from os import getenv
  
  class TestBase(TestCase):
  
      def create_app(self):
  
          # pass in configurations for test database
          config_name = 'testing'
          app.config.update(SQLALCHEMY_DATABASE_URI=getenv('TEST_DB_URI'),
                  SECRET_KEY=getenv('TEST_SECRET_KEY'),
                  WTF_CSRF_ENABLED=False,
                  DEBUG=True
              )
          return app
  
      def setUp(self):
          db.session.commit()
          db.drop_all()
          db.create_all()
  
      def tearDown(self):
          db.session.remove()
          db.drop_all()
  
  class TestViews(TestBase):
  
      def test_weapon_view(self):
          response = self.client.get(url_for('weapon'))
          self.assertEqual(response.status_code, 200)
  
  class TestRepr(TestBase):
  
      def test_weapon_repr(self):
          w = Weapon()
          assert w == 'Test Weapon'