Exemple #1
0
def populate():
    ProfileFactory.create_batch(size=10)
    PostFactory.create_batch(size=4)
    PostImageFactory.create_batch(size=16)
    PaperFactory.create_batch(size=10)

    for p in Post.objects.all():
        print(p)
    print("...population finished")
Exemple #2
0
 def test_post_image(self):
     PostFactory.create_batch(size=2)
     test_image = PostImageFactory(caption='Test')
     self.assertTrue(isinstance(test_image, PostImage))
     self.assertEqual('Test', test_image.__str__())