Esempio n. 1
0
 def setUp(self):
     app = create_app("config/testing.py")
     app.test_request_context().push()
     self.client = app.test_client()
     with self.client.session_transaction() as session:
         session["test"] = True
         session.checker["test"] = True
Esempio n. 2
0
 def setUp(self):
     config_file = "config/deployment.py"
     if os.environ.get("CLA_ENV") is None:
         config_file = "config/common.py"
     self.app = app.create_app(config_file)
     self.app.config["PRESERVE_CONTEXT_ON_EXCEPTION"] = False
     self.ctx = self.app.test_request_context()
     self.ctx.push()
 def setUp(self):
     self.app = create_app("config/testing.py")
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     self.now = datetime.datetime(2014, 11, 24, 9, 30)
     self.validator = None
     self.patcher = mock.patch("cla_common.call_centre_availability.bank_holidays", bank_holidays)
     self.patcher.start()
Esempio n. 4
0
 def setUp(self):
     config_file = "config/deployment.py"
     if os.environ.get("CLA_ENV") is None:
         config_file = "config/common.py"
     self.app = app.create_app(config_file)
     self.app.config["PRESERVE_CONTEXT_ON_EXCEPTION"] = False
     self.ctx = self.app.test_request_context()
     self.ctx.push()
Esempio n. 5
0
 def setUp(self):
     self.patcher = patch("cla_public.libs.utils.get_locale", get_en_locale)
     self.patcher.start()
     self.app = app.create_app("config/testing.py")
     self._ctx = self.app.test_request_context()
     self._ctx.push()
     self.client = self.app.test_client()
     self.now = datetime.datetime(2015, 1, 26, 9, 0)
Esempio n. 6
0
 def setUp(self):
     self.app = create_app("config/testing.py")
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     self.now = datetime.datetime(2014, 11, 24, 9, 30)
     self.validator = None
     self.patcher = mock.patch(
         "cla_common.call_centre_availability.bank_holidays", bank_holidays)
     self.patcher.start()
Esempio n. 7
0
import datetime
import mock
import os
import subprocess
import sys

from flask.ext.script import Manager, Shell, Server
import requests

from cla_public.app import create_app
from cla_public.apps.contact.tests.test_availability import override_current_time


log = logging.getLogger(__name__)
os.environ.setdefault("CLA_PUBLIC_CONFIG", "config/common.py")
app = create_app()
manager = Manager(app)

VENV = os.environ.get("VIRTUAL_ENV", "")


def run(command, **kwargs):
    if "shell" not in kwargs:
        kwargs["shell"] = True

    return_code = subprocess.call(command, **kwargs)
    if return_code:
        sys.exit(return_code)


@manager.command
Esempio n. 8
0
from cla_public.app import create_app

app = create_app(config_file="config/docker.py")
 def setUp(self):
     self.app = create_app("config/testing.py")
     self.app.config["LAALAA_API_HOST"] = "http://laalaa"
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     self.laalaa_search_result = json.loads(
         """{
         "count": 3,
         "next": "https://prod.laalaa.dsd.io/legal-advisers/?category=med&page=2&postcode=SW1A+1AA",
         "previous": null,
         "results": [
             {
                 "telephone": "0207 657 1555",
                 "location": {
                     "address": "50-52 Chancery Lane",
                     "city": "London",
                     "postcode": "WC2A 1HL",
                     "point": {
                         "type": "Point",
                         "coordinates": [
                             -0.112442,
                             51.517
                         ]
                     },
                     "type": "Office"
                 },
                 "organisation": {
                     "name": "Slater & Gordon (Uk) LLP",
                     "website": "www.rjw.co.uk"
                 },
                 "distance": 1.670832439304462,
                 "categories": [
                     "MED",
                     "MAT",
                     "CRM"
                 ]
             },
             {
                 "telephone": "0800 014 7070",
                 "location": {
                     "address": "55 Fleet Street",
                     "city": "London",
                     "postcode": "EC4Y 1JU",
                     "point": {
                         "type": "Point",
                         "coordinates": [
                             -0.108555,
                             51.514096
                         ]
                     },
                     "type": "Office"
                 },
                 "organisation": {
                     "name": "Hudgell Solicitors",
                     "website": "www.hudgellsolicitors.co.uk"
                 },
                 "distance": 1.683935777043317,
                 "categories": [
                     "AAP",
                     "MED"
                 ]
             },
             {
                 "telephone": "0207 405 2000",
                 "location": {
                     "address": "6 New Street Square",
                     "city": "London",
                     "postcode": "EC4A 3DJ",
                     "point": {
                         "type": "Point",
                         "coordinates": [
                             -0.108437,
                             51.51591
                         ]
                     },
                     "type": "Office"
                 },
                 "organisation": {
                     "name": "Blake Morgan LLP",
                     "website": "www.bllaw.co.uk"
                 },
                 "distance": 1.758514717561317,
                 "categories": [
                     "MED"
                 ]
             }
         ],
         "origin": {
             "postcode": "SW1A 1AA",
             "point": {
                 "type": "Point",
                 "coordinates": [
                     -0.141588,
                     51.501009
                 ]
             }
         }
     }"""
     )
 def setUp(self):
     app = create_app("config/testing.py")
     self.client = app.test_client()
     self._html = None
     self._last_session = None
Esempio n. 11
0
 def setUp(self):
     self.app = app.create_app("config/testing.py")
     self.app = self.app.test_client()
     self.validator = None
 def create_flask_app(self):
     return create_app(self.CONFIG_FILE)
Esempio n. 13
0
import logging
import datetime
import mock
import os
import subprocess
import sys

from flask.ext.script import Manager, Shell, Server
import requests

from cla_public.app import create_app
from cla_public.apps.contact.tests.test_availability import override_current_time

log = logging.getLogger(__name__)
os.environ.setdefault("CLA_PUBLIC_CONFIG", "config/common.py")
app = create_app()
manager = Manager(app)

VENV = os.environ.get("VIRTUAL_ENV", "")


def run(command, **kwargs):
    if "shell" not in kwargs:
        kwargs["shell"] = True

    return_code = subprocess.call(command, **kwargs)
    if return_code:
        sys.exit(return_code)


@manager.command
Esempio n. 14
0
 def setUp(self):
     self.app = create_app("config/testing.py")
     ctx = self.app.test_request_context()
     ctx.push()
     self.client = self.app.test_client()
     api.create_diagnosis()
from cla_public.app import create_app

app = create_app(config_file="config/deployment.py")
Esempio n. 16
0
 def setUp(self):
     self.app = create_app("config/testing.py")
     self.app.config["LAALAA_API_HOST"] = "http://laalaa"
     self.ctx = self.app.test_request_context()
     self.ctx.push()
Esempio n. 17
0
 def setUp(self):
     self.app = app.create_app("config/testing.py")
     self.app.test_request_context().push()
     self.client = self.app.test_client()
Esempio n. 18
0
 def setUp(self):
     self.app = create_app("config/testing.py")
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     self.client = self.app.test_client()
     session.checker["case_ref"] = "XX-XXXX-XXXX"
 def setUp(self):
     self.patcher = patch("cla_public.libs.utils.get_locale", get_en_locale)
     self.patcher.start()
     self.app = app.create_app("config/testing.py")
     self._ctx = self.app.test_request_context()
     self._ctx.push()
Esempio n. 20
0
 def setUp(self):
     self.app = create_app("config/testing.py")
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     self.client = self.app.test_client()
     session.checker["case_ref"] = "XX-XXXX-XXXX"
 def setUp(self):
     app = create_app("config/testing.py")
     self.client = app.test_client()
     self._html = None
     self._last_session = None
Esempio n. 22
0
 def setUp(self):
     app = create_app("config/testing.py")
     app.config["OS_PLACES_API_KEY"] = "DUMMY_TOKEN"
     app.test_request_context().push()
 def setUp(self):
     self.app = app.create_app("config/testing.py")
     self.app.test_request_context().push()
     self.client = self.app.test_client()
Esempio n. 24
0
 def setUp(self):
     app = create_app("config/testing.py")
     app.test_request_context().push()
Esempio n. 25
0
 def setUp(self):
     self.patcher = patch("cla_public.libs.utils.get_locale", get_en_locale)
     self.patcher.start()
     self.app = app.create_app("config/testing.py")
     self._ctx = self.app.test_request_context()
     self._ctx.push()
 def setUp(self):
     self.app = create_app("config/testing.py")
     self.app.config["LAALAA_API_HOST"] = "http://laalaa"
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     self.laa_provider_categories_result = {
         "mat": "Family",
         "crm": "Crime",
         "deb": "Debt",
         "med": "Clinical negligence",
     }
     self.laalaa_search_result = json.loads("""{
         "count": 3,
         "next": "https://prod.laalaa.dsd.io/legal-advisers/?category=med&page=2&postcode=SW1A+1AA",
         "previous": null,
         "results": [
             {
                 "telephone": "0207 657 1555",
                 "location": {
                     "address": "50-52 Chancery Lane",
                     "city": "London",
                     "postcode": "WC2A 1HL",
                     "point": {
                         "type": "Point",
                         "coordinates": [
                             -0.112442,
                             51.517
                         ]
                     },
                     "type": "Office"
                 },
                 "organisation": {
                     "name": "Slater & Gordon (Uk) LLP",
                     "website": "www.rjw.co.uk"
                 },
                 "distance": 1.670832439304462,
                 "categories": [
                     "MED",
                     "MAT",
                     "CRM"
                 ]
             },
             {
                 "telephone": "0800 014 7070",
                 "location": {
                     "address": "55 Fleet Street",
                     "city": "London",
                     "postcode": "EC4Y 1JU",
                     "point": {
                         "type": "Point",
                         "coordinates": [
                             -0.108555,
                             51.514096
                         ]
                     },
                     "type": "Office"
                 },
                 "organisation": {
                     "name": "Hudgell Solicitors",
                     "website": "www.hudgellsolicitors.co.uk"
                 },
                 "distance": 1.683935777043317,
                 "categories": [
                     "AAP",
                     "MED"
                 ]
             },
             {
                 "telephone": "0207 405 2000",
                 "location": {
                     "address": "6 New Street Square",
                     "city": "London",
                     "postcode": "EC4A 3DJ",
                     "point": {
                         "type": "Point",
                         "coordinates": [
                             -0.108437,
                             51.51591
                         ]
                     },
                     "type": "Office"
                 },
                 "organisation": {
                     "name": "Blake Morgan LLP",
                     "website": "www.bllaw.co.uk"
                 },
                 "distance": 1.758514717561317,
                 "categories": [
                     "MED"
                 ]
             }
         ],
         "origin": {
             "postcode": "SW1A 1AA",
             "point": {
                 "type": "Point",
                 "coordinates": [
                     -0.141588,
                     51.501009
                 ]
             }
         }
     }""")