Beispiel #1
0
 def test_login_krive_vrijednosti(self):
     tester = app.test_client()
     response = tester.post('/',
                            data=dict(korisnicko_ime="wrong",
                                      password="******"),
                            follow_redirects=True)
     self.assertIn(b'ime ili lozinka', response.data)
Beispiel #2
0
 def test_login_prave_vrijednosti(self):
     tester = app.test_client()
     response = tester.post('/',
                            data=dict(korisnicko_ime='admin',
                                      password='******'),
                            follow_redirects=True)
     self.assertIn(b'Prijavljeni ste', response.data)
Beispiel #3
0
 def test_pretraga(self):
     tester = app.test_client(self)
     tester.post('/',
                 data={
                     'korisnicko_ime': 'admin',
                     'password': '******'
                 },
                 follow_redirects=True)
     response = tester.get('/admin_popis_korisnika', follow_redirects=True)
     self.assertIn(b'Tip', response.data)
Beispiel #4
0
 def test_logout(self):
     tester = app.test_client()
     tester.post('/',
                 data={
                     'korisnicko_ime': 'admin',
                     'password': '******'
                 },
                 follow_redirects=True)
     response = tester.get('/logout', follow_redirects=True)
     self.assertIn(b'Odjava', response.data)
Beispiel #5
0
 def test_index(self):
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     self.assertEqual(response.status_code, 200)
Beispiel #6
0
 def test_ucitavanje_apija(self):
     tester = app.test_client()
     response = tester.get('/opcina/KOPRIVNIČKO-KRIŽEVAČKA')
     self.assertIn(b'Virje', response.data)
Beispiel #7
0
 def test_oglasiopg(self):
     tester = app.test_client()
     response = tester.get('/oglasiOpgova', follow_redirects=True)
     self.assertIn(b'Proizvodu', response.data)
Beispiel #8
0
 def test_main_route_requires_login(self):
     tester = app.test_client()
     response = tester.get('/admin_popis_korisnika', follow_redirects=True)
     self.assertIn(b'Morate se prijaviti', response.data)
Beispiel #9
0
 def test_login_page_loads(self):
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     self.assertTrue(b'Lozinka' in response.data)