def setUp(self):
     app.config['TESTING'] = True
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['DEBUG'] = False
     self.app = app.test_client()
     warnings.filterwarnings("ignore",
                             category=ResourceWarning,
                             message="unclosed.*<ssl.SSLSocket.*>")
Пример #2
0
 def setUp(self):
     self.app = app.test_client()
     self.app.testing = True
     self.sampleResponse = {
         "title":
         "Young The Giant with Grouplove",
         "url":
         "https://seatgeek.com/young-the-giant-with-grouplove-tickets/new-york-new-york-terminal-5-2012-03-09/concert/721901/",
         "datetime_local":
         "2012-03-09T19:00:00",
         "performers": [{
             "name": "Young The Giant",
             "short_name": "Young The Giant",
             "url": "https://seatgeek.com/young-the-giant-tickets/",
             "image":
             "https://chairnerd.global.ssl.fastly.net/images/bandshuge/band_8741.jpg",
             "primary": True,
             "id": 8741,
             "score": 6404,
             "type": "band",
             "slug": "young-the-giant"
         }],
         "venue": {
             "extended_address": "Baker Street",
             "country": "US",
             "state": "NY",
             "address": "ABC Store",
             "id": 814
         },
         "datetime_utc":
         "2012-03-10T00:00:00",
         "type":
         "concert",
         "id":
         721901,
         "description":
         "Sample",
         "status_code":
         200,
     }
Пример #3
0
    def test_post(self):

        self.test_app = app.test_client()

        response = self.test_app.get('/', content_type='html/text')
        self.assertEqual(response.status_code, 200)
Пример #4
0
 def test_index(self):
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     self.assertEqual(response.status_code, 200)
Пример #5
0
 def test_index_404(self):
     tester = app.test_client(self)
     response = tester.get('/404/', content_type='html/text')
     self.assertTrue(
         b'OOPS!!!! PAGE NOT FOUND!! PLEASE RETURN TO HOMEPAGE BY CLICKING ON THE HEADER, OTHERWISE CLICK ONE OF THE TABS ABOVE =]'
         in response.data)
Пример #6
0
 def test_index_Map(self):
     tester = app.test_client(self)
     response = tester.get('/Map/', content_type='html/text')
     self.assertTrue(b'Japan on Google Maps' in response.data)
Пример #7
0
 def setUp(self):
     handler_app.testing = True
     self.client = handler_app.test_client()
Пример #8
0
 def test_user(self, val):
     tester = app.test_client()
     response = tester.get("/user/test_user")
     self.assertEqual(response.status, '200 OK')
     self.assertEqual(response.json, get_user_result)
Пример #9
0
 def test_index_Supra(self):
     tester = app.test_client(self)
     response = tester.get('/Supra/', content_type='html/text')
     self.assertTrue(b'Toyota Supra (year 93-02)' in response.data)
Пример #10
0
 def test_index_DC5(self):
     tester = app.test_client(self)
     response = tester.get('/DC5', content_type='html/text')
     self.assertTrue(b'Honda Integra DC5 (year 01-06)' in response.data)
Пример #11
0
 def test_index_homepage(self):
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     self.assertTrue(b'Welcome to JDM Cars' in response.data)
Пример #12
0
 def setUp(self):
     self.app = app.test_client()
     self.db = db.get_db()
Пример #13
0
 def setUp(self):
     app.config['TESTING'] = True
     app.config['WTF_CSRF_METHODS'] = []  # This is the magic
     self.app = app.test_client()
Пример #14
0
def client():
    return index_app.test_client()
def client():
    app.config['TESTING'] = True
    client = app.test_client()
    yield client
Пример #16
0
 def test_index_S15(self):
     tester = app.test_client(self)
     response = tester.get('/S15/', content_type='html/text')
     self.assertTrue(b'Nissan S15 (year 99-02)' in response.data)
Пример #17
0
 def setUp(self):
     self.app = app.test_client()
Пример #18
0
 def test_index_Chaser(self):
     tester = app.test_client(self)
     response = tester.get('/Chaser/', content_type='html/text')
     self.assertTrue(b'Toyota Chaser (year 96-01)' in response.data)
Пример #19
0
 def test_NotExist(self, mock):
     tester = app.test_client()
     response = tester.get("/user/test_user123")
     self.assertEqual(response.status, '404 NOT FOUND')
Пример #20
0
 def setUp(self):
     api = app.test_client()
     self.response = api.get('cidade/Penápolis/BR')