How to use the tasklib.lazy.LazyUUIDTask function in tasklib

To help you get started, we’ve selected a few tasklib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github robgolding / tasklib / tasklib / tests.py View on Github external
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
github robgolding / tasklib / tasklib / tests.py View on Github external
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
github robgolding / tasklib / tasklib / tests.py View on Github external
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
github robgolding / tasklib / tasklib / tests.py View on Github external
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
github robgolding / tasklib / tasklib / tests.py View on Github external
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'])
github robgolding / tasklib / tasklib / tests.py View on Github external
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
github robgolding / tasklib / tasklib / lazy.py View on Github external
def __iter__(self):
        for uuid in self._uuids:
            yield LazyUUIDTask(self._tw, uuid)
github robgolding / tasklib / tasklib / lazy.py View on Github external
def __deepcopy__(self, memo):
        return LazyUUIDTask(self._tw, self._uuid)
github robgolding / tasklib / tasklib / lazy.py View on Github external
def __copy__(self):
        return LazyUUIDTask(self._tw, self._uuid)
github robgolding / tasklib / tasklib / serializing.py View on Github external
def deserialize_parent(self, uuid):
        return LazyUUIDTask(self.backend, uuid) if uuid else None