def setUpTestData(cls): cls.client = Client() category = Category() category.name = "News" category.slug = "news" category.save() a = Article() a.title = "Test article 1" a.slug = "test-article-1" a.category = Category.objects.get(name="News") a.save() a.publish_now() h = TwitterHandle() h.name = "groundup_news" h.slug = "groundup_news" h.save() t = Tweet() t.article = a t.wait_time = 0 t.status = "scheduled" t.tweet_text = "Test tweet " + str(a.published) t.save() t.tag_accounts.add(h) t.save()
def setUp(self): category = Category() category.name = "News" category.slug = "news" category.save() a = Article() a.title = "Test article 1" a.slug = "test-article-1" a.category = Category.objects.get(name="News") a.save() a.publish_now() h = TwitterHandle() h.name = "groundup_news" h.slug = "groundup_news" h.save() t = Tweet() t.article = a t.wait_time = 0 t.status = "scheduled" t.tweet_text = "Test tweet " + str(a.published) t.save() t.tag_accounts.add(h) t.save()
def setUpTestData(cls): cls.client = Client() topic = Topic() topic.name = "government" topic.slug = "government" topic.save() category = Category() category.name = "Feature" category.slug = "feature" category.save() category = Category() category.name = "Photo essay" category.slug = "photo-essay" category.save() category = Category() category.name = "Opinion" category.slug = "opinion" category.save() category = Category() category.name = "Photo" category.slug = "photo" category.save() category = Category() category.name = "News" category.slug = "news" category.save() a = Article() a.title = "Test article 1" a.body = "<p>The quick brown fox jumps over the lazy dog.</p>" a.slug = "test-article-1" a.category = Category.objects.get(name="News") a.external_primary_image = \ "http://www.w3schools.com/html/pic_mountain.jpg" a.save() a.publish_now() a = Article() a.title = "Test article 2" a.subtitle = "Dogs and things" a.body = "<p>How now brown cow.</p>" a.slug = "test-article-2" a.category = Category.objects.get(slug="opinion") a.save() a.publish_now() author = Author() author.first_names = "Joe" author.last_name = "Bloggs" author.email = "*****@*****.**" author.save() a.author_01 = author a.save()
def setUpTestData(cls): republisher = Republisher() republisher.name = "NYT" republisher.email_addresses = "[email protected],[email protected]" republisher.message = "Hi. Please republish this." republisher.save() topic = Topic() topic.name = "government" topic.slug = "government" topic.save() category = Category() category.name = "Feature" category.slug = "feature" category.save() category = Category() category.name = "Photo essay" category.slug = "photo-essay" category.save() category = Category() category.name = "Opinion" category.slug = "opinion" category.save() category = Category() category.name = "Photo" category.slug = "photo" category.save() category = Category() category.name = "News" category.slug = "news" category.save() article = Article() article.title = "Test article 1" article.body = "<p>The quick brown fox jumps over the lazy dog.</p>" article.slug = "test-article-1" article.category = Category.objects.get(name="News") article.external_primary_image = \ "http://www.w3schools.com/html/pic_mountain.jpg" article.save() article.publish_now() republisherArticle = RepublisherArticle() republisherArticle.article = article republisherArticle.republisher = republisher republisherArticle.save()
def setUp(self): topic = Topic() topic.name = "government" topic.slug = "government" topic.save() category = Category() category.name = "Feature" category.slug = "feature" category.save() category = Category() category.name = "Photo essay" category.slug = "photo-essay" category.save() category = Category() category.name = "Opinion" category.slug = "opinion" category.save() category = Category() category.name = "Photo" category.slug = "photo" category.save() category = Category() category.name = "News" category.slug = "news" category.save() a = Article() a.title = "Test article 1" a.slug = "test-article-1" a.category = Category.objects.get(name="News") a.external_primary_image = \ "http://www.w3schools.com/html/pic_mountain.jpg" a.save() a.publish_now() a = Article() a.title = "Test article 2" a.slug = "test-article-2" a.category = Category.objects.get(slug="opinion") a.save() a.publish_now()