Esempio n. 1
0
 def test_vote_locked_form1(self):
     # type: () -> None
     do_test_vote(self,
                  "user1", ["Vim", "Sublime", "Windows"], ["Atom", "Linux"],
                  ["Sublime"],
                  200, ["Vim", "Sublime", "Linux"],
                  locked_titles=["Text Editor"])
Esempio n. 2
0
 def test_vote_form_empty(self):
     # type: () -> None
     do_test_vote(self, "user1", None, None, None, 200, [])
     do_test_vote(self, "user2", None, None, None, 200, [], "application/json")
     do_test_vote(self, "user3", None, None, None, 200, [], FORM_CONTENT_TYPE)
     do_test_vote(self, "user1", None, None, None, 200, [], "application/json;")
     do_test_vote(self, "user2", None, None, None, 200, [], FORM_CONTENT_TYPE + ";")
Esempio n. 3
0
 def test_vote_locked_form2(self):
     # type: () -> None
     do_test_vote(self,
                  "user3", ["Vim", "Sublime", "Windows"], ["Atom", "Linux"],
                  ["Sublime"],
                  200, ["Vim", "Sublime", "Linux"],
                  FORM_CONTENT_TYPE,
                  locked_titles=["Text Editor"])
Esempio n. 4
0
 def test_vote_locked_json(self):
     # type: () -> None
     do_test_vote(self,
                  "user2", ["Vim", "Sublime", "Windows"], ["Atom", "Linux"],
                  ["Sublime"],
                  200, ["Vim", "Sublime", "Linux"],
                  "application/json",
                  locked_titles=["Text Editor"])
Esempio n. 5
0
 def test_vote_form_empty(self):
     # type: () -> None
     do_test_vote(self, "user1", None, None, None, 200, [])
     do_test_vote(self, "user2", None, None, None, 200, [],
                  "application/json")
     do_test_vote(self, "user3", None, None, None, 200, [],
                  FORM_CONTENT_TYPE)
     do_test_vote(self, "user1", None, None, None, 200, [],
                  "application/json;")
     do_test_vote(self, "user2", None, None, None, 200, [],
                  FORM_CONTENT_TYPE + ";")
Esempio n. 6
0
 def test_vote_inboth(self):
     # type: () -> None
     do_test_vote(self, "user1", ["Vim", "Sublime"], ["Vim", "Atom"],
                  ["Vim"], 400, ["Vim", "Sublime"])
     do_test_vote(self, "user2", ["Vim", "Sublime"], ["Vim", "Atom"],
                  ["Vim"], 400, ["Vim", "Sublime"], "application/json")
     do_test_vote(self, "user3", ["Vim", "Sublime"], ["Vim", "Atom"],
                  ["Vim"], 400, ["Vim", "Sublime"], FORM_CONTENT_TYPE)
Esempio n. 7
0
 def test_vote_unchoose_only(self):
     # type: () -> None
     do_test_vote(self, "user1", ["Vim", "Atom"], None, ["Vim", "Linux"],
                  200, ["Atom"])
     do_test_vote(self, "user2", ["Vim", "Atom"], None, ["Vim", "Linux"],
                  200, ["Atom"], "application/json")
     do_test_vote(self, "user3", ["Vim", "Atom"], None, ["Vim", "Linux"],
                  200, ["Atom"], FORM_CONTENT_TYPE)
Esempio n. 8
0
 def test_vote_locked_form2(self):
     # type: () -> None
     do_test_vote(self, "user3", ["Vim", "Sublime", "Windows"], ["Atom", "Linux"], ["Sublime"],
                  200, ["Vim", "Sublime", "Linux"], FORM_CONTENT_TYPE, locked_titles=["Text Editor"])
Esempio n. 9
0
 def test_vote_locked_json(self):
     # type: () -> None
     do_test_vote(self, "user2", ["Vim", "Sublime", "Windows"], ["Atom", "Linux"], ["Sublime"],
                  200, ["Vim", "Sublime", "Linux"], "application/json", locked_titles=["Text Editor"])
Esempio n. 10
0
 def test_vote_locked_form1(self):
     # type: () -> None
     do_test_vote(self, "user1", ["Vim", "Sublime", "Windows"], ["Atom", "Linux"], ["Sublime"],
                  200, ["Vim", "Sublime", "Linux"], locked_titles=["Text Editor"])
Esempio n. 11
0
 def test_vote_num_inboth(self):
     # type: () -> None
     do_test_vote(self, "user2", ["Vim", "Sublime"], ["Vim", "Atom"], ["Vim"], 400, ["Vim", "Sublime"], "application/json", True)
Esempio n. 12
0
 def test_vote_num_unchoose_only(self):
     # type: () -> None
     do_test_vote(self, "user1", ["Vim", "Atom"], None, ["Vim", "Linux"], 200, ["Atom"], "application/json", True)
Esempio n. 13
0
 def test_vote_inboth(self):
     # type: () -> None
     do_test_vote(self, "user1", ["Vim", "Sublime"], ["Vim", "Atom"], ["Vim"], 400, ["Vim", "Sublime"])
     do_test_vote(self, "user2", ["Vim", "Sublime"], ["Vim", "Atom"], ["Vim"], 400, ["Vim", "Sublime"], "application/json")
     do_test_vote(self, "user3", ["Vim", "Sublime"], ["Vim", "Atom"], ["Vim"], 400, ["Vim", "Sublime"], FORM_CONTENT_TYPE)
Esempio n. 14
0
 def test_vote_unchoose_only(self):
     # type: () -> None
     do_test_vote(self, "user1", ["Vim", "Atom"], None, ["Vim", "Linux"], 200, ["Atom"])
     do_test_vote(self, "user2", ["Vim", "Atom"], None, ["Vim", "Linux"], 200, ["Atom"], "application/json")
     do_test_vote(self, "user3", ["Vim", "Atom"], None, ["Vim", "Linux"], 200, ["Atom"], FORM_CONTENT_TYPE)
Esempio n. 15
0
 def test_vote_num_inboth(self):
     # type: () -> None
     do_test_vote(self, "user2", ["Vim", "Sublime"], ["Vim", "Atom"],
                  ["Vim"], 400, ["Vim", "Sublime"], "application/json",
                  True)
Esempio n. 16
0
 def test_vote_num_unchoose_only(self):
     # type: () -> None
     do_test_vote(self, "user1", ["Vim", "Atom"], None, ["Vim", "Linux"],
                  200, ["Atom"], "application/json", True)