Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

api.signup is disabled so don't test it

  • Loading branch information...
commit 2c0281a0482c2ed4f0d207636e60ffc3d8d3ade2 1 parent 8e28bc0
Justine Tunney authored
Showing with 51 additions and 51 deletions.
  1. +51 −51 occupywallst/tests.py
View
102 occupywallst/tests.py
@@ -509,57 +509,57 @@ def test_api_check_username(self):
j = assert_and_get_valid_json(response)
assert j['status'] == 'ZERO_RESULTS', jdump(j) # this means success
- def test_api_signup(self):
- # already taken
- response = self.client.post('/api/signup/',
- {'username': self.red_user.username,
- 'password': '123456',
- 'email': 'new@occupywallst.org'})
- j = assert_and_get_valid_json(response)
- assert j['status'] == 'ERROR', jdump(j)
-
- # password too short
- response = self.client.post('/api/signup/',
- {'username': 'new_user',
- 'password': '1234',
- 'email': 'new@occupywallst.org'})
- j = assert_and_get_valid_json(response)
- assert j['status'] == 'ERROR', jdump(j)
-
- # email no good
- response = self.client.post('/api/signup/',
- {'username': 'new_user',
- 'password': '123456',
- 'email': 'new@occupy'})
- j = assert_and_get_valid_json(response)
- assert j['status'] == 'ERROR', jdump(j)
-
- # just right
- response = self.client.post('/api/signup/',
- {'username': 'new_user',
- 'password': '123456',
- 'email': 'new@occupywallst.org'})
- j = assert_and_get_valid_json(response)
- assert j['status'] == 'OK', jdump(j)
-
- # but trying it again fails, because we're now logged in
- response = self.client.post('/api/signup/',
- {'username': 'new_user',
- 'password': '123456',
- 'email': 'new@occupywallst.org'})
- j = assert_and_get_valid_json(response)
- assert j['status'] == 'ERROR', jdump(j)
- assert 'logged in' in j['message'], jdump(j)
-
- # and even if we log out, it still fails, because the user now exists
- self.client.post('/api/logout/')
- response = self.client.post('/api/signup/',
- {'username': 'new_user',
- 'password': '123456',
- 'email': 'new@occupywallst.org'})
- j = assert_and_get_valid_json(response)
- assert j['status'] == 'ERROR', jdump(j)
- assert j['message'] == 'username is taken', jdump(j)
+ # def test_api_signup(self):
+ # # already taken
+ # response = self.client.post('/api/signup/',
+ # {'username': self.red_user.username,
+ # 'password': '123456',
+ # 'email': 'new@occupywallst.org'})
+ # j = assert_and_get_valid_json(response)
+ # assert j['status'] == 'ERROR', jdump(j)
+
+ # # password too short
+ # response = self.client.post('/api/signup/',
+ # {'username': 'new_user',
+ # 'password': '1234',
+ # 'email': 'new@occupywallst.org'})
+ # j = assert_and_get_valid_json(response)
+ # assert j['status'] == 'ERROR', jdump(j)
+
+ # # email no good
+ # response = self.client.post('/api/signup/',
+ # {'username': 'new_user',
+ # 'password': '123456',
+ # 'email': 'new@occupy'})
+ # j = assert_and_get_valid_json(response)
+ # assert j['status'] == 'ERROR', jdump(j)
+
+ # # just right
+ # response = self.client.post('/api/signup/',
+ # {'username': 'new_user',
+ # 'password': '123456',
+ # 'email': 'new@occupywallst.org'})
+ # j = assert_and_get_valid_json(response)
+ # assert j['status'] == 'OK', jdump(j)
+
+ # # but trying it again fails, because we're now logged in
+ # response = self.client.post('/api/signup/',
+ # {'username': 'new_user',
+ # 'password': '123456',
+ # 'email': 'new@occupywallst.org'})
+ # j = assert_and_get_valid_json(response)
+ # assert j['status'] == 'ERROR', jdump(j)
+ # assert 'logged in' in j['message'], jdump(j)
+
+ # # and even if we log out, it still fails, because the user now exists
+ # self.client.post('/api/logout/')
+ # response = self.client.post('/api/signup/',
+ # {'username': 'new_user',
+ # 'password': '123456',
+ # 'email': 'new@occupywallst.org'})
+ # j = assert_and_get_valid_json(response)
+ # assert j['status'] == 'ERROR', jdump(j)
+ # assert j['message'] == 'username is taken', jdump(j)
def test_api_login_and_logout(self):
# should be same for invalid username and invalid password,
Please sign in to comment.
Something went wrong with that request. Please try again.