Fix username conflicts with test suite and the…

…check_supportBDS_migrations script.
This commit is contained in:
Aurélien Delobelle 2017-10-28 18:08:40 +02:00
parent 09a96a0375
commit 09a88f768d
2 changed files with 6 additions and 6 deletions

View file

@ -31,21 +31,21 @@ class Command(BaseCommand):
def check_users(self): def check_users(self):
self.stdout.write("* Utilisateurs... ", ending='') self.stdout.write("* Utilisateurs... ", ending='')
self.u1 = User.objects.get(username='user1') self.u1 = User.objects.get(username='cbds_user1')
assert self.u1.profile.login_clipper == 'user1' assert self.u1.profile.login_clipper == 'user1'
assert self.g_staff in self.u1.groups.all() assert self.g_staff in self.u1.groups.all()
assert self.g_members in self.u1.groups.all() assert self.g_members in self.u1.groups.all()
assert self.u1.has_perm('cof.buro') assert self.u1.has_perm('cof.buro')
assert self.u1.has_perm('cof.member') assert self.u1.has_perm('cof.member')
self.u2 = User.objects.get(username='user2') self.u2 = User.objects.get(username='cbds_user2')
assert self.u2.profile.login_clipper == 'user2' assert self.u2.profile.login_clipper == 'user2'
assert self.g_staff not in self.u2.groups.all() assert self.g_staff not in self.u2.groups.all()
assert self.g_members in self.u2.groups.all() assert self.g_members in self.u2.groups.all()
assert not self.u2.has_perm('cof.buro') assert not self.u2.has_perm('cof.buro')
assert self.u2.has_perm('cof.member') assert self.u2.has_perm('cof.member')
self.u3 = User.objects.get(username='user3') self.u3 = User.objects.get(username='cbds_user3')
assert self.u3.profile.login_clipper == 'user3' assert self.u3.profile.login_clipper == 'user3'
assert self.g_staff not in self.u3.groups.all() assert self.g_staff not in self.u3.groups.all()
assert self.g_members not in self.u3.groups.all() assert self.g_members not in self.u3.groups.all()

View file

@ -34,13 +34,13 @@ def load_olddata(apps, schema_editor):
) )
# Setup users. # Setup users.
u1 = load_user(apps, 'user1', is_cof=True) u1 = load_user(apps, 'cbds_user1', is_cof=True)
u1.profile.is_buro = True u1.profile.is_buro = True
u1.profile.save() u1.profile.save()
u2 = load_user(apps, 'user2', is_cof=True) u2 = load_user(apps, 'cbds_user2', is_cof=True)
u3 = load_user(apps, 'user3') u3 = load_user(apps, 'cbds_user3')
# Setup clubs. # Setup clubs.
Club = apps.get_model('cof', 'Club') Club = apps.get_model('cof', 'Club')