コード例 #1
0
 def setUp(self):
     self.client = Client()
     self.category = CategoryFactory()
     self.test_author1 = AuthorFactory(name='xyz', slug="xyz")
     self.test_article_author1 = ArticleAuthors(author=self.test_author1,
                                                sort_order=0)
     self.test_article_author1b = ArticleAuthors(author=self.test_author1,
                                                 sort_order=0)
     self.test_author2 = AuthorFactory(name='abc', slug="abc")
     self.test_article_author2 = ArticleAuthors(author=self.test_author2,
                                                sort_order=1)
     self.test_article_author2b = ArticleAuthors(author=self.test_author2,
                                                 sort_order=1)
     self.english_article = ArticleFactory(
         title="english_article",
         authors=(self.test_article_author1, ),
         language='en',
         first_published_at='2011-10-24 12:43')
     self.hindi_article = ArticleFactory(
         title="hindi_article",
         authors=(self.test_article_author1b, self.test_article_author2),
         language='hi',
         first_published_at='2011-10-25 12:43')
     self.dummy_article = ArticleFactory(
         title="dummy_article",
         authors=(self.test_article_author2b, ),
         language='en',
         first_published_at='2011-10-23 12:43')
コード例 #2
0
 def setUp(self):
     self.author = AuthorFactory()
     self.author1 = AuthorFactory(name="donald", slug="donald")
     self.location = LocationFactory()
     self.category = CategoryFactory()
     self.image = ImageFactory(photographers=(self.author, self.author1),
                               locations=(self.location, ),
                               categories=(self.category, ))
コード例 #3
0
 def setUp(self):
     self.client = Client()
     self.test_author = AuthorFactory(name='xyz', slug="xyz")
     self.test_article_author = ArticleAuthors(author=self.test_author,
                                               sort_order=0)
     self.article = ArticleFactory(title="english_article",
                                   authors=(self.test_article_author, ),
                                   language='en')
コード例 #4
0
 def test_multiple_authors_can_be_added_to_a_article(self):
     author = AuthorFactory(name='Test')
     article = ArticleFactory(title="Multiple Author Article",
                              authors=(
                                  self.test_author,
                                  author,
                              ))
     self.assertEqual(len(article.authors.all()), 2)
     self.assertEqual(article.authors.all()[1].name, 'Test')
コード例 #5
0
 def setUpClass(cls):
     super(TestHomePage, cls).setUpClass()
     author1 = AuthorFactory.create()
     author2 = AuthorFactory.create(name="Karthik", slug="srk")
     category1 = CategoryFactory.create(name="Resource Conflicts", slug="resource-conflicts", order=1, description="Jal, jungle, zameen")
     category2 = CategoryFactory.create(name="Adivasis", slug="adivasis", order=2, description="The first dwellers")
     category3 = CategoryFactory.create(name="Dalits", slug="dalits", order=3, description="Struggles of the oppressed")
     category4 = CategoryFactory.create(name="Rural Sports", slug="sports-games", order=4, description="Games people play")
     location1 = LocationFactory.create()
     location2 = LocationFactory.create(name="Madurai", slug="madurai")
     image = ImageFactory.create(photographers=(author1,), locations=(location1,))
     setup = DataSetup()
     article1 = setup.create_article("article1", author1, category1, location1, image)
     article2 = setup.create_article("article2", author2, category2, location2, image)
     video_article = setup.create_video_article("video article", author2, location1, image)
     talking_album = setup.create_talking_album(image)
     photo_album = setup.create_photo_album(image)
     HomePageFactory.create(carousel_0=article1, carousel_1=article2, in_focus_page1=article1, in_focus_page2=article2, video=video_article, talking_album=talking_album, photo_album=photo_album)
コード例 #6
0
 def setUp(self):
     self.client = Client()
     self.author = AuthorFactory(name='test', slug="test")
     self.article_author = ArticleAuthors(author=self.author, sort_order=0)
     self.article = ArticleFactory(title="test article",
                                   authors=(self.article_author, ),
                                   language='en')
     self.article = ArticleFactory(title="test modular article",
                                   show_modular_content=True)
コード例 #7
0
ファイル: tests.py プロジェクト: hemendra-srivastava/pari
 def setUp(self):
     author1 = AuthorFactory.create(name='Test1')
     author2 = AuthorFactory.create(name='Test2')
     author3 = AuthorFactory.create(name='Test3')
     location1 = LocationFactory.create(name="Madurai", slug="madurai")
     image1 = ImageFactory.create(photographers=(
         author1,
         author2,
     ),
                                  locations=(location1, ))
     self.talking_album1 = TalkingAlbumSlideFactory(
         image=image1,
         page__title="Talking Album 1",
         page__first_published_at='2011-10-24 12:43')
     self.talking_album2 = TalkingAlbumSlideFactory(
         image=image1,
         page__title="Talking Album 2",
         page__first_published_at='2011-10-25 12:43')
     self.photo_album = PhotoAlbumSlideFactory(image=image1)
コード例 #8
0
ファイル: tests.py プロジェクト: hemendra-srivastava/pari
 def setUp(self):
     self.author1 = AuthorFactory.create(name='Test1')
     self.author2 = AuthorFactory.create(name='Test2')
     self.author3 = AuthorFactory.create(name='Test3')
     location1 = LocationFactory.create(name="Madurai", slug="madurai")
     image1 = ImageFactory.create(photographers=(
         self.author1,
         self.author2,
     ),
                                  locations=(location1, ))
     image2 = ImageFactory.create(photographers=(
         self.author1,
         self.author3,
     ),
                                  locations=(location1, ))
     self.album = AlbumFactory(title="Base Album")
     self.talking_album = TalkingAlbumSlideFactory(image=image1,
                                                   page=self.album)
     self.talking_album1 = TalkingAlbumSlideFactory(image=image2,
                                                    page=self.album)
コード例 #9
0
 def setUp(self):
     client = Client()
     self.test_author = AuthorFactory(name='xyz', slug="xyz")
     self.english_article = ArticleFactory(
         title="english_article",
         first_published_at='2017-4-24 12:43',
         language='en')
     self.hindi_article = ArticleFactory(
         title="hindi_article",
         first_published_at='2017-4-25 12:43',
         language='hi')
コード例 #10
0
ファイル: test_article_page.py プロジェクト: enkaynitin/pari
 def setUpClass(cls):
     super(TestArticlePage, cls).setUpClass()
     author = AuthorFactory.create(name="Nimesh", slug="puli")
     category = CategoryFactory.create(name="Adivasis",
                                       slug="adivasis",
                                       order=2,
                                       description="The first dwellers")
     location = LocationFactory.create(name="Madurai", slug="madurai")
     image = ImageFactory.create(photographers=(author, ),
                                 locations=(location, ))
     setup = DataSetup()
     dummy_article = setup.create_article("Dummy", author, category,
                                          location, image)
     modular_article = setup.create_article("Article Page",
                                            author,
                                            category,
                                            location,
                                            image,
                                            show_modular_content=True,
                                            modular_content=json.dumps(
                                                get_modular_content(
                                                    dummy_article.id,
                                                    image.id, location.id)))
コード例 #11
0
ファイル: tests.py プロジェクト: malkum/pari
 def test_should_throw_error_if_facebook_and_twitter_name__of_author_exceeds_fifty_characters(self):
     with self.assertRaises(DataError) as context_message:
         AuthorFactory(name='some author',
                       twitter_username='******')
         AuthorFactory(name='some good author',
                       facebook_username='******')
コード例 #12
0
ファイル: tests.py プロジェクト: malkum/pari
 def test_author_string_representaion(self):
     assert str(AuthorFactory()) == 'V. Sasikumar'
コード例 #13
0
ファイル: test_views.py プロジェクト: malkum/pari
 def setUp(self):
     self.client = Client()
     self.author = AuthorFactory(name='test', slug="test")
     self.article = ArticleFactory(title="test article", authors=(self.author,), language='en')
コード例 #14
0
 def setUp(self):
     self.test_author = AuthorFactory(name='xyz', slug="xyz")
     self.article = ArticleFactory(title="english_article",
                                   authors=(self.test_author, ),
                                   language='en')