Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_normal_to_lazy_inequality(self):
# Create a different UUID by changing the last letter
wrong_uuid = self.stored['uuid']
wrong_uuid = wrong_uuid[:-1] + ('a' if wrong_uuid[-1] != 'a' else 'b')
wrong_lazy = LazyUUIDTask(self.tw, wrong_uuid)
assert not self.stored == wrong_lazy
assert self.stored != wrong_lazy
assert type(wrong_lazy) is LazyUUIDTask
def test_lazy_to_lazy_inequality(self):
# Create a different UUID by changing the last letter
wrong_uuid = self.stored['uuid']
wrong_uuid = wrong_uuid[:-1] + ('a' if wrong_uuid[-1] != 'a' else 'b')
lazy1 = LazyUUIDTask(self.tw, self.stored['uuid'])
lazy2 = LazyUUIDTask(self.tw, wrong_uuid)
assert not lazy1 == lazy2
assert lazy1 != lazy2
assert type(lazy1) is LazyUUIDTask
assert type(lazy2) is LazyUUIDTask
def test_lazy_to_lazy_equality(self):
lazy1 = LazyUUIDTask(self.tw, self.stored['uuid'])
lazy2 = LazyUUIDTask(self.tw, self.stored['uuid'])
assert lazy1 == lazy2
assert not lazy1 != lazy2
assert type(lazy1) is LazyUUIDTask
assert type(lazy2) is LazyUUIDTask
def test_lazy_to_lazy_inequality(self):
# Create a different UUID by changing the last letter
wrong_uuid = self.stored['uuid']
wrong_uuid = wrong_uuid[:-1] + ('a' if wrong_uuid[-1] != 'a' else 'b')
lazy1 = LazyUUIDTask(self.tw, self.stored['uuid'])
lazy2 = LazyUUIDTask(self.tw, wrong_uuid)
assert not lazy1 == lazy2
assert lazy1 != lazy2
assert type(lazy1) is LazyUUIDTask
assert type(lazy2) is LazyUUIDTask
def setUp(self):
super(LazyUUIDTaskTest, self).setUp()
self.stored = Task(self.tw, description='this is test task')
self.stored.save()
self.lazy = LazyUUIDTask(self.tw, self.stored['uuid'])
def test_lazy_in_queryset(self):
tasks = self.tw.tasks.filter(uuid=self.stored['uuid'])
assert self.lazy in tasks
assert type(self.lazy) is LazyUUIDTask
def __iter__(self):
for uuid in self._uuids:
yield LazyUUIDTask(self._tw, uuid)
def __deepcopy__(self, memo):
return LazyUUIDTask(self._tw, self._uuid)
def __copy__(self):
return LazyUUIDTask(self._tw, self._uuid)
def deserialize_parent(self, uuid):
return LazyUUIDTask(self.backend, uuid) if uuid else None