Commit 4bc4787e authored by Daniel Gal's avatar Daniel Gal
Browse files

Display name in question tests

parent 6ecdea8f
Pipeline #3818 passed with stage
in 6 minutes and 38 seconds
......@@ -33,9 +33,11 @@ class VotingTestCase(APITestCase):
def setUp(self):
# Users
submitter = Profile.objects.create(
user=User.objects.create(username="submitter")
user=User.objects.create(username="submitter"), display_name="submitter"
)
Profile.objects.create(
user=User.objects.create(username="voter"), display_name="voter"
)
Profile.objects.create(user=User.objects.create(username="voter"))
# Content
question = Question.objects.create(
title="What is love?",
......@@ -142,7 +144,9 @@ class TwoVotersQuestion(VotingTestCase):
def setUp(self):
super().setUp()
Profile.objects.create(user=User.objects.create(username="voter2"))
Profile.objects.create(
user=User.objects.create(username="voter2"), display_name="voter2"
)
def prepare(self):
super().prepare()
......@@ -261,9 +265,11 @@ class AnswerQuestionTestCase(APITestCase):
def setUp(self):
# Users
submitter = Profile.objects.create(
user=User.objects.create(username="submitter")
user=User.objects.create(username="submitter"), display_name="submitter"
)
Profile.objects.create(
user=User.objects.create(username="answerer"), display_name="answerer"
)
Profile.objects.create(user=User.objects.create(username="answerer"))
# Content
Question.objects.create(
title="What is love?",
......@@ -326,9 +332,11 @@ class DeleteQuestionTestCase(APITestCase):
def setUp(self):
# Users
submitter = Profile.objects.create(
user=User.objects.create(username="submitter")
user=User.objects.create(username="submitter"), display_name="submitter"
)
Profile.objects.create(
user=User.objects.create(username="other_user"), display_name="other_user"
)
Profile.objects.create(user=User.objects.create(username="other_user"))
# Content
Question.objects.create(
title="What is love?",
......@@ -375,9 +383,11 @@ class PutQuestionTestCase(APITestCase):
def setUp(self):
# Users
submitter = Profile.objects.create(
user=User.objects.create(username="submitter")
user=User.objects.create(username="submitter"), display_name="submitter"
)
Profile.objects.create(
user=User.objects.create(username="other_user"), display_name="other_user"
)
Profile.objects.create(user=User.objects.create(username="other_user"))
# Content
Question.objects.create(
title="What is love?",
......@@ -459,9 +469,11 @@ class PostQuestionTestCase(APITestCase):
def setUp(self):
# Users
submitter = Profile.objects.create(
user=User.objects.create(username="submitter")
user=User.objects.create(username="submitter"), display_name="submitter"
)
Profile.objects.create(
user=User.objects.create(username="other_user"), display_name="other_user"
)
Profile.objects.create(user=User.objects.create(username="other_user"))
# Content
Question.objects.create(
title="What is love?",
......@@ -502,10 +514,12 @@ class EditAnswerTestCase(APITestCase):
def setUp(self):
# Users
submitter = Profile.objects.create(
user=User.objects.create(username="submitter")
user=User.objects.create(username="submitter"), display_name="submitter"
)
Profile.objects.create(user=User.objects.create(username="other_user"))
Profile.objects.create(
user=User.objects.create(username="other_user"), display_name="other_user"
)
# Content
question = Question.objects.create(
......@@ -576,15 +590,18 @@ class AcceptAnswerTestCase(APITestCase):
def setUp(self):
# Users
question_submitter = Profile.objects.create(
user=User.objects.create(username="question_submitter")
user=User.objects.create(username="question_submitter"),
display_name="question_submitter",
)
answer_submitter_0 = Profile.objects.create(
user=User.objects.create(username="answer_submitter_0")
user=User.objects.create(username="answer_submitter_0"),
display_name="answer_submitter_0",
)
answer_submitter_1 = Profile.objects.create(
user=User.objects.create(username="answer_submitter_1")
user=User.objects.create(username="answer_submitter_1"),
display_name="answer_submitter_1",
)
# Content
......@@ -721,15 +738,18 @@ class DeleteAnswerTestCase(APITestCase):
def setUp(self):
# Users
question_submitter = Profile.objects.create(
user=User.objects.create(username="question_submitter")
user=User.objects.create(username="question_submitter"),
display_name="question_submitter",
)
answer_submitter_0 = Profile.objects.create(
user=User.objects.create(username="answer_submitter_0")
user=User.objects.create(username="answer_submitter_0"),
display_name="answer_submitter_0",
)
answer_submitter_1 = Profile.objects.create(
user=User.objects.create(username="answer_submitter_1")
user=User.objects.create(username="answer_submitter_1"),
display_name="answer_submitter_1",
)
# Content
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment