Răsfoiți Sursa

sessions in test OK

ash 2 ani în urmă
părinte
comite
a80be4cd78
1 a modificat fișierele cu 22 adăugiri și 1 ștergeri
  1. 22 1
      Backend/Tests/core_test.py

+ 22 - 1
Backend/Tests/core_test.py

@@ -42,12 +42,33 @@ def fixture2():
 
 def test_login() :
 
+    s = requests.Session()
+
+    r = s.post("http://127.0.0.1:8000/api/login",json={'username' : 'admin','password': 'aseqzdwxc'})
+    print(r.__dict__)
+    assert r.status_code == 200
+
+    r = s.get("http://127.0.0.1:8000/tab")
+    print(r.__dict__)
+    assert r.status_code == 200
 
 
-    r = requests.post("http://192.168.1.86:8000/api/login",json={'username' : 'admin','password': 'aseqzdwxc'})
+def test_inventory() :
+    s = requests.Session()
+
+    r = s.post("http://127.0.0.1:8000/api/login",json={'username' : 'admin','password': 'aseqzdwxc'})
     print(r.__dict__)
     assert r.status_code == 200
 
+    r = s.get("http://127.0.0.1:8000/tab")
+    print(r.__dict__)
+    assert r.status_code == 200
+
+
+
+
+
+