Bases: django.test.testcases.TestCase
Bases: django.test.testcases.TestCase
Bases: django.test.testcases.TestCase
Bases: django.test.testcases.TestCase
Create new LockUser, set attributes, save to database
Check that custom save assigns (creates and saves) new RFIDkeycard for this LockUser
Are the access times (access_time field for AccessTime object) for this LockUser the same as those returned by get_all_access_times (or None)
Does get_all_rfids() returns all RFIDkeycards objects associated with Lockuser
Check that method returns the correctly formatted html string of all rfids, NOT including the current one
Does get_allowed_doors() return the door(s), if any, that the lockuser is allowed to access
Is the last access time for this LockUser the same as that returned by get_last_access_time (or None)
Check that method returns the correctly formatted html string
Bases: django.test.testcases.TestCase
On deactivation, is RFIDkeycard object’s date revoked and revoker set correctly?
Bases: django.test.testcases.TestCase
Bases: django.test.testcases.TestCase
Everything went ok (no active keycard with this RFID num already; a NewKeycardScan object with this pk does exist and has an RFID num; not timed out), so can assign keycard.
A keycard with the same RFID is already assigned to another lockuser
No NewKeycardScan object with the pk specified in the URL
NewKeycardScan object did not get an RFID num
Longer than x minutes to scan new card – timed out
Lockuser with specified id exists, does not have assigned keycard: - check for appropriate response - and that a new NewKeycardScan object is created, - and it has correct attributes (waiting_for_scan = True;
assigner_user = request.user)
Bases: django.test.testcases.TestCase
Test that get_object_type custom filter returns the object.
Bases: django.test.testcases.TestCase
list of allowed RFIDs does not contain any inactive ones
get all allowed RFIDs for door in wrong format (incorrect url)
Check: since the latest NewKeycardScan object is waiting_for_scan, don’t attempt to authenticate, just return 0; do not create an AccessTime
Bases: django.test.testcases.LiveServerTestCase
Bases: django.test.testcases.LiveServerTestCase
Change form for an active (i.e. has assigned keycard) lock user: after checking ‘Deactivate current keycard’ and saving, does the change list show the deactivation/saved message? Does the change list show this lockuser as inactive? Back on the change form, there should not be an assigned keycard (Current RFID: None) and ‘Deactivate current keycard’ should be unchecked.
Tests is the situation where the lock user is permitted access to some door(s), but not the one(s) the staff user is allowed access to. That is, on the change form, there will be no checked Door(s), so checking ‘Deactive keycard’ should not deactivate the keycard.
Check that staff users do not see a ‘delete’ button/link on the form page for an individual Lock User. (This is for an existing LockUser – when adding a LockUser there would not be a ‘delete’ link/button in any case.)
Bases: django.test.testcases.LiveServerTestCase
This is a walkthrough for: adding a lockuser to the system, and assigning a keycard. The sequence of events:
Staff user... - logs in - (main page loads (currently /lockadmin/rfid_lock_management/)) - clicks ‘New user’ button - (add form loads (/lockadmin/rfid_lock_management/lockuser/add/) ) - fills out all fields - selects a door checkbox - clicks <input type=”submit” value=”Save and continue editing”
name=”_continue” class=”btn”>
clicks <input type=”button” class=”btn” id=”add_keycard_button” value=”Assign keycard”>
<to do at this point – will find_element_by_* find the element below if the enclosing div is not visible, since it itself is not explicitly set to not be visible? Depending on answer, might have to insert new events/checks in here............. >
clicks <input type=”button” class=”btn” id=”start_button” value=”Scan new card”>
opens new browser window and goes to address e.g. http://192.168.x.x:port_num/checkdoor//checkrfid (obv use liveserver variable)
back to previous window
clicks <input type=”button” class=”btn” id=”done_button” value=”Done”>
clicks <input type=”submit” value=”Save” class=”btn” name=”_save”>
(change list loads)
information, status, RFID, etc. *