Bläddra i källkod

sessions in test OK

ash 2 år sedan
förälder
incheckning
a80be4cd78
1 ändrade filer med 22 tillägg och 1 borttagningar
  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
+
+
+
+
+
+