-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
105 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run] | ||
|
||
include: pydiscourse/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,16 +35,14 @@ def test_user(self, request): | |
self.assertRequestCalled(request, 'GET', '/users/someuser.json') | ||
|
||
def test_create_user(self, request): | ||
pass | ||
self.client.create_user('Test User', 'testuser', '[email protected]', 'notapassword') | ||
self.assertEqual(request.call_count, 2) | ||
# XXX incomplete | ||
|
||
def test_activate_user(self, request): | ||
self.client.activate_user(22) | ||
self.assertRequestCalled(request, 'PUT', '/admin/users/22/activate') | ||
|
||
def test_activate_user_invalid_id(self, request): | ||
with self.assertRaises(ValueError): | ||
self.client.activate_user('notavaliduid') | ||
|
||
def test_update_email(self, request): | ||
email = '[email protected]' | ||
self.client.update_email('someuser', email) | ||
|
@@ -78,10 +76,6 @@ def test_topic(self, request): | |
self.client.topic(22) | ||
self.assertRequestCalled(request, 'GET', '/t/22.json') | ||
|
||
def test_topic_invalid(self, request): | ||
with self.assertRaises(ValueError): | ||
self.client.topic('notavalidtopicid') | ||
|
||
def test_topics_by(self, request): | ||
r = self.client.topics_by('someuser') | ||
self.assertRequestCalled(request, 'GET', '/topics/created-by/someuser.json') | ||
|
@@ -92,10 +86,6 @@ def invite_user_to_topic(self, request): | |
self.client.invite_user_to_topic(email, 22) | ||
self.assertRequestCalled(request, 'POST', '/t/22/invite.json', email=email, topic_id=22) | ||
|
||
def invite_user_to_topic_invalid_topic(self, request): | ||
with self.assertRaises(ValueError): | ||
self.client.invite_user_to_topic('someuser', 'invalidtopicid') | ||
|
||
|
||
@mock.patch('requests.request') | ||
class MiscellaneousTests(ClientBaseTestCase): | ||
|