def setUpUsers(self): self.other_user = utils.create_user( username="******", email="*****@*****.**", date_joined=self.setup_timestamp, status="m" ) self.target_user = utils.create_user( username="******", email="*****@*****.**", notification_schedule=self.notification_schedule, date_joined=self.setup_timestamp, status="m", )
def setUpUsers(self): self.other_user = utils.create_user(username='******', email='*****@*****.**', date_joined=self.setup_timestamp, status='m') self.target_user = utils.create_user( username='******', email='*****@*****.**', notification_schedule=self.notification_schedule, date_joined=self.setup_timestamp, status='m')
def setUpUsers(self): self.other_user = utils.create_user( username = '******', email = '*****@*****.**', date_joined = self.setup_timestamp, status = 'm' ) self.target_user = utils.create_user( username = '******', email = '*****@*****.**', notification_schedule = self.notification_schedule, date_joined = self.setup_timestamp, status = 'm' )
def setUp(self): # An administrator user self.owner = User.objects.create_user(username='******', email='*****@*****.**', password='******') self.owner.is_staff = True self.owner.is_superuser = True self.owner.save() # A moderator self.mod1 = create_user(username='******', email='*****@*****.**', status='m') self.mod1.set_password('modpw') self.mod1.save() # A normal user User.objects.create_user(username='******', email='*****@*****.**', password='******') # Setup a small category tree self.root = Category.objects.create(name=u'Root') self.c1 = Category.objects.create(name=u'Child1', parent=self.root) self.c2 = Category.objects.create(name=u'Child2', parent=self.c1) c3 = Category.objects.create(name=u'Child3', parent=self.root) self.tag1 = Tag.objects.create(name=u'Tag1', created_by=self.owner) self.tag2 = Tag.objects.create(name=u'Tag2', created_by=self.owner) self.tag2.categories.add(self.c1) self.tag3 = Tag.objects.create(name=u'Tag3', created_by=self.owner) self.tag3.categories.add(c3) askbot_settings.update('ENABLE_CATEGORIES', True) askbot_settings.update('CATEGORIES_MAX_TREE_DEPTH', 3)
def setUp(self): # users for the question self.u11 = create_user("user11", "*****@*****.**", status="m") self.u12 = create_user("user12", "*****@*****.**", status="m") self.u13 = create_user("user13", "*****@*****.**", status="m") self.u14 = create_user("user14", "*****@*****.**", status="m") # users for first answer self.u21 = create_user("user21", "*****@*****.**", status="m") # post answer self.u22 = create_user("user22", "*****@*****.**", status="m") # edit answer self.u23 = create_user("user23", "*****@*****.**", status="m") self.u24 = create_user("user24", "*****@*****.**", status="m") # users for second answer self.u31 = create_user("user31", "*****@*****.**", status="m") # post answer self.u32 = create_user("user32", "*****@*****.**", status="m") # edit answer self.u33 = create_user("user33", "*****@*****.**", status="m") self.u34 = create_user("user34", "*****@*****.**", status="m") # a hack to initialize .users list self.reload_users() # pre-populate askbot with some content # create a question and two answers, each post gets two comments # users have two digit codes. What users do in the setup code # is explained below (x is a variable that takes integer values of [1-3]) # user x1 makes a post, users x2 and x3 add comments to that post # users 1x work on question, 2x and 3x on the answers # users x4 do not do anyting in the setup code self.question = models.Question.objects.create_new( title="test question", author=self.u11, added_at=datetime.datetime.now(), wiki=False, tagnames="test", text="hey listen up", ) self.comment12 = self.question.add_comment(user=self.u12, comment="comment12") self.comment13 = self.question.add_comment(user=self.u13, comment="comment13") self.answer1 = models.Answer.objects.create_new( question=self.question, author=self.u21, added_at=datetime.datetime.now(), text="answer1" ) self.comment22 = self.answer1.add_comment(user=self.u22, comment="comment22") self.comment23 = self.answer1.add_comment(user=self.u23, comment="comment23") self.answer2 = models.Answer.objects.create_new( question=self.question, author=self.u31, added_at=datetime.datetime.now(), text="answer2" ) self.comment32 = self.answer2.add_comment(user=self.u32, comment="comment32") self.comment33 = self.answer2.add_comment(user=self.u33, comment="comment33")
def setUp(self): #users for the question self.u11 = create_user('user11', '*****@*****.**', status='m') self.u12 = create_user('user12', '*****@*****.**', status='m') self.u13 = create_user('user13', '*****@*****.**', status='m') self.u14 = create_user('user14', '*****@*****.**', status='m') #users for first answer self.u21 = create_user('user21', '*****@*****.**', status='m') #post answer self.u22 = create_user('user22', '*****@*****.**', status='m') #edit answer self.u23 = create_user('user23', '*****@*****.**', status='m') self.u24 = create_user('user24', '*****@*****.**', status='m') #users for second answer self.u31 = create_user('user31', '*****@*****.**', status='m') #post answer self.u32 = create_user('user32', '*****@*****.**', status='m') #edit answer self.u33 = create_user('user33', '*****@*****.**', status='m') self.u34 = create_user('user34', '*****@*****.**', status='m') #a hack to initialize .users list self.reload_users() #pre-populate askbot with some content #create a question and two answers, each post gets two comments #users have two digit codes. What users do in the setup code #is explained below (x is a variable that takes integer values of [1-3]) #user x1 makes a post, users x2 and x3 add comments to that post #users 1x work on question, 2x and 3x on the answers #users x4 do not do anyting in the setup code self.question = models.Question.objects.create_new( title='test question', author=self.u11, added_at=datetime.datetime.now(), wiki=False, tagnames='test', text='hey listen up', ) self.comment12 = self.question.add_comment(user=self.u12, comment='comment12') self.comment13 = self.question.add_comment(user=self.u13, comment='comment13') self.answer1 = models.Answer.objects.create_new( question=self.question, author=self.u21, added_at=datetime.datetime.now(), text='answer1') self.comment22 = self.answer1.add_comment(user=self.u22, comment='comment22') self.comment23 = self.answer1.add_comment(user=self.u23, comment='comment23') self.answer2 = models.Answer.objects.create_new( question=self.question, author=self.u31, added_at=datetime.datetime.now(), text='answer2') self.comment32 = self.answer2.add_comment(user=self.u32, comment='comment32') self.comment33 = self.answer2.add_comment(user=self.u33, comment='comment33')
def setUp(self): #users for the exercise self.u11 = create_user('user11', '*****@*****.**', status='m') self.u12 = create_user('user12', '*****@*****.**', status='m') self.u13 = create_user('user13', '*****@*****.**', status='m') self.u14 = create_user('user14', '*****@*****.**', status='m') #users for first problem self.u21 = create_user('user21', '*****@*****.**', status='m')#post problem self.u22 = create_user('user22', '*****@*****.**', status='m')#edit problem self.u23 = create_user('user23', '*****@*****.**', status='m') self.u24 = create_user('user24', '*****@*****.**', status='m') #users for second problem self.u31 = create_user('user31', '*****@*****.**', status='m')#post problem self.u32 = create_user('user32', '*****@*****.**', status='m')#edit problem self.u33 = create_user('user33', '*****@*****.**', status='m') self.u34 = create_user('user34', '*****@*****.**', status='m') #a hack to initialize .users list self.reload_users() #pre-populate askbot with some content #create a exercise and two problems, each post gets two comments #users have two digit codes. What users do in the setup code #is explained below (x is a variable that takes integer values of [1-3]) #user x1 makes a post, users x2 and x3 add comments to that post #users 1x work on exercise, 2x and 3x on the problems #users x4 do not do anyting in the setup code self.thread = models.Thread.objects.create_new( title = 'test exercise', author = self.u11, added_at = datetime.datetime.now(), wiki = False, tagnames = 'test', text = 'hey listen up', ) self.exercise = self.thread._exercise_post() self.comment12 = self.exercise.add_comment( user = self.u12, comment = 'comment12' ) self.comment13 = self.exercise.add_comment( user = self.u13, comment = 'comment13' ) self.problem1 = models.Post.objects.create_new_problem( thread = self.thread, author = self.u21, added_at = datetime.datetime.now(), text = 'problem1' ) self.comment22 = self.problem1.add_comment( user = self.u22, comment = 'comment22' ) self.comment23 = self.problem1.add_comment( user = self.u23, comment = 'comment23' ) self.problem2 = models.Post.objects.create_new_problem( thread = self.thread, author = self.u31, added_at = datetime.datetime.now(), text = 'problem2' ) self.comment32 = self.problem2.add_comment( user = self.u32, comment = 'comment32' ) self.comment33 = self.problem2.add_comment( user = self.u33, comment = 'comment33' )
def create_other_user(self): return utils.create_user( username = '******', email = '*****@*****.**' )
def setUp(self): self.user = utils.create_user( username = '******', email = '*****@*****.**' ) self.extraSetUp()
def setUp(self): #users for the exercise self.u11 = create_user('user11', '*****@*****.**', status='m') self.u12 = create_user('user12', '*****@*****.**', status='m') self.u13 = create_user('user13', '*****@*****.**', status='m') self.u14 = create_user('user14', '*****@*****.**', status='m') #users for first problem self.u21 = create_user('user21', '*****@*****.**', status='m') #post problem self.u22 = create_user('user22', '*****@*****.**', status='m') #edit problem self.u23 = create_user('user23', '*****@*****.**', status='m') self.u24 = create_user('user24', '*****@*****.**', status='m') #users for second problem self.u31 = create_user('user31', '*****@*****.**', status='m') #post problem self.u32 = create_user('user32', '*****@*****.**', status='m') #edit problem self.u33 = create_user('user33', '*****@*****.**', status='m') self.u34 = create_user('user34', '*****@*****.**', status='m') #a hack to initialize .users list self.reload_users() #pre-populate askbot with some content #create an exercise and two problems, each post gets two comments #users have two digit codes. What users do in the setup code #is explained below (x is a variable that takes integer values of [1-3]) #user x1 makes a post, users x2 and x3 add comments to that post #users 1x work on exercise, 2x and 3x on the problems #users x4 do not do anyting in the setup code self.thread = models.Thread.objects.create_new( title='test exercise', author=self.u11, added_at=datetime.datetime.now(), wiki=False, tagnames='test', text='hey listen up', ) self.exercise = self.thread._exercise_post() self.comment12 = self.exercise.add_comment(user=self.u12, comment='comment12') self.comment13 = self.exercise.add_comment(user=self.u13, comment='comment13') self.problem1 = models.Post.objects.create_new_problem( thread=self.thread, author=self.u21, added_at=datetime.datetime.now(), text='problem1') self.comment22 = self.problem1.add_comment(user=self.u22, comment='comment22') self.comment23 = self.problem1.add_comment(user=self.u23, comment='comment23') self.problem2 = models.Post.objects.create_new_problem( thread=self.thread, author=self.u31, added_at=datetime.datetime.now(), text='problem2') self.comment32 = self.problem2.add_comment(user=self.u32, comment='comment32') self.comment33 = self.problem2.add_comment(user=self.u33, comment='comment33')