mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-11-22 09:31:29 -08:00
19 lines
559 B
Python
19 lines
559 B
Python
from django.test import TestCase
|
|
from audio.models import Feed
|
|
from django.contrib.auth.models import User
|
|
from uuid import UUID
|
|
|
|
|
|
class FeedModelTestCase(TestCase):
|
|
|
|
def setUp(self):
|
|
user_a = User.objects.create(username='user_a')
|
|
Feed.objects.create(user=user_a, title='Civil War')
|
|
|
|
def test_feed(self):
|
|
qs = Feed.objects.all()
|
|
self.assertEquals(len(qs), 1)
|
|
feed_a = Feed.objects.get(title='Civil War')
|
|
self.assertTrue(isinstance(feed_a.pk, UUID))
|
|
self.assertEquals(str(feed_a), feed_a.title)
|