def properties_test(self): registred_date = datetime.datetime name ="Test Device" active = True identity = "TEST" device = Device() device.active = active device.name = name device.device_id = identity device.registered_date = registred_date self.assertEquals(device.active, active) self.assertEquals(device.name, name) self.assertEquals(device.device_id, identity) self.assertEquals(device.registered_date, registred_date)
def get(self, device_id=None): logging.info('Get Edit device {0}'.format(device_id)) device = Device.query_device_id(device_key, device_id) if device is None: device = Device() device.device_id = '' device.name = '' owner_name = '' if device.owner is not None: owner_name = device.owner.nickname() if device.active: device_active = "checked=""checked""" else: device_active = "" logging.info('device loaded {0}'.format(device.device_id)) viewbag = {'device_name': device.name, 'device_id': device.device_id, 'device_active': device_active, 'device_owner': owner_name} template = self.load_template('editdevice.html') return self.response.out.write(template.render(viewbag))