Exemplo n.º 1
0
    def test_entry_can_have_tags(self):
        entry = EntryFactory.create()

        # defaults to empty list.
        assert entry.tags == []

        entry.tags = ['tag1', 'tag2']
        entry.save()

        assert Entry.objects.get(pk=entry.pk).tags == ['tag1', 'tag2']

        entry.tags = ['tag1']
        entry.save()

        assert Entry.objects.get(pk=entry.pk).tags == ['tag1']
Exemplo n.º 2
0
 def test_identifier_can_be_blank(self):
     entry = EntryFactory.create()
     assert entry.identifier == ''
Exemplo n.º 3
0
    def test_entry_has_uuid_as_primary_key(self):
        entry = EntryFactory.create()

        # raises on invalid uuid
        uuid.UUID(str(entry.pk))
Exemplo n.º 4
0
 def test_has_user(self):
     entry = EntryFactory.create()
     assert entry.user is not None