def test_batch_with_deletion(self): delete_with_reversion(self.new_author) add_versions_to_batch(self.batch, changed_items()) serialized = serialize_batch(self.key.decode('hex'), self.batch) with self.assertRaises(ObjectDoesNotExist): process_batch(self.key.decode('hex'), serialized['batch'], serialized['iv'])
def push_test_batch(): """ pushes empty batch to server to test settings and returns True on success """ try: key = settings.NUDGE_KEY.decode('hex') response = send_command('batch/', serialize_batch(key, Batch())) return False if response.getcode() != 200 else True except: return False
def test_batch_with_deletion(self): delete_with_reversion(self.new_author) add_versions_to_batch(self.batch, changed_items()) serialized= serialize_batch(self.key.decode('hex'),self.batch) with self.assertRaises(ObjectDoesNotExist): # because it doesn't exist anymore in this database processed_batch=process_batch(self.key.decode('hex'), serialized['batch'], serialized['iv'])
def test_batch_serialization_and_processing(self): add_versions_to_batch(self.batch, changed_items()) serialized= serialize_batch(self.key.decode('hex'),self.batch) processed_batch=process_batch(self.key.decode('hex'), serialized['batch'], serialized['iv'])
def test_batch_serialization_and_processing(self): add_versions_to_batch(self.batch, changed_items()) serialized = serialize_batch(self.key.decode('hex'), self.batch) process_batch(self.key.decode('hex'), serialized['batch'], serialized['iv'])