Add location field to devices with dropdown selector
This commit is contained in:
@@ -498,6 +498,25 @@ def test_edit_device_type(client):
|
||||
assert b"Flashlight" in resp.data
|
||||
|
||||
|
||||
def test_add_device_with_location(client):
|
||||
resp = client.post("/device/add",
|
||||
data={"name": "Bedroom Remote", "battery_slots": "2", "location": "Bedroom"},
|
||||
follow_redirects=True)
|
||||
assert resp.status_code == 200
|
||||
assert b"Bedroom Remote" in resp.data
|
||||
resp = client.get("/device/1")
|
||||
assert b"Bedroom" in resp.data
|
||||
|
||||
|
||||
def test_edit_device_location(client):
|
||||
client.post("/device/add", data={"name": "Living Room Clock", "battery_slots": "1"})
|
||||
resp = client.post("/device/1/edit",
|
||||
data={"name": "Living Room Clock", "battery_slots": "1", "location": "Living Room"},
|
||||
follow_redirects=True)
|
||||
assert resp.status_code == 200
|
||||
assert b"Living Room" in resp.data
|
||||
|
||||
|
||||
def test_add_capacity_test(client):
|
||||
client.post("/battery/add", data={"brand": "Eneloop", "count": "1"})
|
||||
resp = client.post("/battery/1/capacity-test/add",
|
||||
|
||||
Reference in New Issue
Block a user