def setUp(self): self.user = factory.create_user('*****@*****.**', '*****@*****.**', 'john123', 'John', 'Doe') self.location = factory.create_location('Thailand', 'Nakhonsawan') self.category = factory.create_category('Travel', 'travel') self.blog = factory.create_blog('Travel in Nakhonsawan', self.user, self.category, self.location) self.user_with_notification = factory.create_user('*****@*****.**', '*****@*****.**', 'adam123', 'Adam', 'Johnson') self.notification = Notification(subject=self.user_with_notification, action=1, blog=self.blog) self.notification.save()
def setUp(self): self.category = factory.create_category() self.user = factory.create_user() self.location = factory.create_location() self.blogs = [ factory.create_blog('Hello world', self.user, self.category, self.location, 1), factory.create_blog('Hello world', self.user, self.category, self.location, 2), factory.create_blog('Hello world', self.user, self.category, self.location, 3), factory.create_blog('Hello world', self.user, self.category, self.location, 4), factory.create_blog('Hello world', self.user, self.category, self.location, 5), factory.create_blog('Hello world', self.user, self.category, self.location, 6), factory.create_blog('Hello world', self.user, self.category, self.location, 7), factory.create_blog('Hello world', self.user, self.category, self.location, 8), factory.create_blog('Hello world', self.user, self.category, self.location, 9), factory.create_blog('Hello world', self.user, self.category, self.location, 10), factory.create_blog('Hello world', self.user, self.category, self.location, 99) ]
def setUp(self): self.client = Client() self.user = factory.create_user('*****@*****.**', '*****@*****.**', '1234', 'John', 'Doe') self.category = factory.create_category('Travel', 'travel') self.location = factory.create_location('Czech', 'Praque', 0, 0) self.blog = factory.create_blog('Visit Praque', self.user, self.category, self.location)