# Path: tests_python/util_tests.py
# class TestApp(TestCase):
# class NullAuthForm(Form):
# class NullAuth(AuthMethod):
# class TestLogin(TestApp):
#     def setUp(self):
#     def tearDown(self):
#     def login(self, form):
#     def view(self):
#     def form(self):
#     def setUp(self):
#     def login(self, username=None):
#     def normal_user(self):
#     def admin_user(self):
# def response(*args, **kwargs):
# def paxswill_zkillboard(url, request):
# def no_alliance_zkillboard(url, request):
# def foxfour_esi(url, request):


import re
from httmock import HTTMock
from evesrp import db
from evesrp.models import Request
from evesrp.auth import PermissionType
from evesrp.auth.models import Pilot, Division, Permission
from evesrp import views
from ...util_tests import TestLogin, all_mocks
            fail_form.details.raw_data = fail_form.details.data
            self.assertFalse(fail_form.validate())

    def test_submit_killmail(self):
        with self.app.test_request_context():
            user = self.normal_user
            pilot = Pilot(user, 'Paxswill', 570140137)
            db.session.add(pilot)
            db.session.commit()
            division = Division.query.filter_by(name='Division 1').one()
        client = self.login()
        with HTTMock(*all_mocks):
            resp = client.post('/request/add/', follow_redirects=True,
                    data=dict(
                        url='https://zkillboard.com/kill/37637533/',
                        details='Foo',
                        division=division.id,
                        submit=True))
        self.assertEqual(resp.status_code, 200)
        self.assertIn('37637533', resp.get_data(as_text=True))
        with self.app.test_request_context():
            request = Request.query.get(37637533)
            self.assertIsNotNone(request)

    def test_submit_non_personal_killmail(self):
        with self.app.test_request_context():
            user = self.normal_user
            pilot = Pilot(user, 'The Mittani', 443630591)
            db.session.add(pilot)
            db.session.commit()

# Path: tests_python/util_tests.py
# class TestApp(TestCase):
# class NullAuthForm(Form):
# class NullAuth(AuthMethod):
# class TestLogin(TestApp):
#     def setUp(self):
#     def tearDown(self):
#     def login(self, form):
#     def view(self):
#     def form(self):
#     def setUp(self):
#     def login(self, username=None):
#     def normal_user(self):
#     def admin_user(self):
# def response(*args, **kwargs):
# def paxswill_zkillboard(url, request):
# def no_alliance_zkillboard(url, request):
# def foxfour_esi(url, request):


# Path: tests_python/views/requests/test_submit.py
import re
from httmock import HTTMock
from evesrp import db
from evesrp.models import Request
from evesrp.auth import PermissionType
from evesrp.auth.models import Pilot, Division, Permission
from evesrp import views
from ...util_tests import TestLogin, all_mocks

            fail_form.details.raw_data = fail_form.details.data
            self.assertFalse(fail_form.validate())

    def test_submit_killmail(self):
        with self.app.test_request_context():
            user = self.normal_user
            pilot = Pilot(user, 'Paxswill', 570140137)
            db.session.add(pilot)
            db.session.commit()
            division = Division.query.filter_by(name='Division 1').one()
        client = self.login()
        with HTTMock(*all_mocks):
            resp = client.post('/request/add/', follow_redirects=True,
                    data=dict(
                        url='https://zkillboard.com/kill/37637533/',
                        details='Foo',
                        division=division.id,
                        submit=True))
        self.assertEqual(resp.status_code, 200)
        self.assertIn('37637533', resp.get_data(as_text=True))
        with self.app.test_request_context():
            request = Request.query.get(37637533)
            self.assertIsNotNone(request)

    def test_submit_non_personal_killmail(self):
        with self.app.test_request_context():
            user = self.normal_user
            pilot = Pilot(user, 'The Mittani', 443630591)
            db.session.add(pilot)
            db.session.commit()

            division = Division.query.filter_by(name='Division 1').one()