forked from OSQA/osqa
-
Notifications
You must be signed in to change notification settings - Fork 625
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Group.objects.get_or_create() - adds visibility parameter, returns tuple (group, created) to match the behavior of django.db.models.Manager.get_or_create() switch to this signature where this method is used - PEP8 cleanup * adds test case for askbot_create_per_email_domain_groups
- Loading branch information
1 parent
5f1a856
commit 8d3d6e2
Showing
12 changed files
with
274 additions
and
236 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
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
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 |
---|---|---|
|
@@ -376,3 +376,15 @@ def test_askbot_send_moderation_alerts1(self): | |
#command sends alerts to three moderators at a time | ||
self.assertEqual(len(mail.outbox), 2) | ||
self.assertTrue('moderation' in mail.outbox[0].subject) | ||
|
||
|
||
def test_askbot_create_per_email_domain_groups(self): | ||
user1 = self.create_user('org1', '[email protected]') | ||
user2 = self.create_user('org2', '[email protected]') | ||
count = models.Group.objects.filter(name__in=('Org1', 'Org2')).count() | ||
self.assertEqual(count, 0) | ||
management.call_command('askbot_create_per_email_domain_groups') | ||
count = models.Group.objects.filter(name__in=('Org1', 'Org2')).count() | ||
self.assertEqual(count, 2) | ||
|
||
|
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
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
Oops, something went wrong.