-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
8 changed files
with
31 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Remove team domain | ||
Revision ID: 07f975f81f03 | ||
Revises: 4e206c5ddabd | ||
Create Date: 2017-08-04 15:12:11.992856 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '07f975f81f03' | ||
down_revision = '4e206c5ddabd' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.drop_index('ix_team_domain', table_name='team') | ||
op.drop_column('team', 'domain') | ||
|
||
|
||
def downgrade(): | ||
op.add_column('team', sa.Column('domain', sa.VARCHAR(length=253), autoincrement=False, nullable=True)) | ||
op.create_index('ix_team_domain', 'team', ['domain'], unique=False) |
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 |
---|---|---|
|
@@ -167,34 +167,6 @@ def test_organization_available_permissions(self): | |
self.assertIsInstance(org_with_permissions, list) | ||
self.assertItemsEqual(org_with_permissions, [netizens]) | ||
|
||
def test_organization_domain(self): | ||
""" | ||
Test for retrieving team members in a Organization based on domain | ||
""" | ||
|
||
# scenario 1: domain valid is None | ||
allegiant = models.Organization(name=u'allegiant', title=u'Allegiant') | ||
self.assertEqual(allegiant.domain, None) | ||
|
||
# scenario 2: no teams in organzation | ||
allegiant_domain = u'allegiants.com' | ||
allegiant.domain = allegiant_domain | ||
self.assertEqual(allegiant.domain, allegiant_domain) | ||
|
||
# scenario 3: members dont have same domain as domain value | ||
beatrice = models.User(username=u'beatrice', fullname=u'Beatrice Prior', email=u'[email protected]') | ||
tobias = models.User(username=u'tobias', fullname=u'Tobias Eaton', email=u'[email protected]') | ||
erudite = models.Organization(name=u'erudite', title=u'Erudite') | ||
erudite.owners.users.append(beatrice) | ||
erudite.members.users.append(tobias) | ||
db.session.add(beatrice) | ||
db.session.add(tobias) | ||
db.session.add(erudite) | ||
db.session.commit() | ||
erudite.domain = u'erudites.com' | ||
self.assertEqual(erudite.domain, u'erudites.com') | ||
self.assertItemsEqual(erudite.teams, [erudite.owners, erudite.members]) | ||
|
||
def test_organization_name(self): | ||
""" | ||
Test for retrieving Organization's name | ||
|
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