Exemple #1
0
 def setUp(self):
     super(TestMigrateUnconfirmedEmails, self).setUp()
     self.registered_user = factories.UserFactory()
     self.unconfirmed = factories.UnconfirmedUserFactory()
     self.unregistered = factories.UnregUserFactory()
     self.unregistered.emails = [self.unregistered.username]
     self.unregistered.save()
Exemple #2
0
    def _add_unregistered_user(self):
        self.unregistered = factories.UnregUserFactory()

        self.project_with_unreg_contrib = factories.ProjectFactory()
        self.project_with_unreg_contrib.add_unregistered_contributor(
            fullname='Unreg',
            email=self.unregistered.username,
            auth=auth.Auth(self.project_with_unreg_contrib.creator))
        self.project_with_unreg_contrib.save()
Exemple #3
0
 def test_unreg_users_do_show_on_projects(self):
     with run_celery_tasks():
         unreg = factories.UnregUserFactory(fullname='Robert Paulson')
         self.project = factories.ProjectFactory(
             title='Glamour Rock',
             creator=unreg,
             is_public=True,
         )
     results = query(unreg.fullname)['results']
     assert_equal(len(results), 1)
Exemple #4
0
    def test_merge_unconfirmed_into_unmergeable(self):
        self.user.add_addon('unmergeable')
        self.user.save()
        # sanity check
        assert_false(self.user.can_be_merged)

        unconf = factories.UnconfirmedUserFactory()
        # make sure this doesn't raise an exception
        self.user.merge_user(unconf)

        unreg = factories.UnregUserFactory()
        # make sure this doesn't raise an exception
        self.user.merge_user(unreg)
Exemple #5
0
    def test_merge_unmergeable_into_mergeable(self):
        # These states should never happen in the current codebase...
        #   but that's why we have tests.
        unconfirmed = factories.UnconfirmedUserFactory()
        unconfirmed.add_addon('unmergeable')

        with assert_raises(exceptions.MergeConflictError):
            self.user.merge_user(unconfirmed)

        unregistered = factories.UnregUserFactory()
        unregistered.add_addon('unmergeable')

        with assert_raises(exceptions.MergeConflictError):
            self.user.merge_user(unregistered)
Exemple #6
0
    def setUp(self):
        super(UserTestCase, self).setUp()
        self.user = factories.AuthUserFactory()
        self.unregistered = factories.UnregUserFactory()
        self.unconfirmed = factories.UnconfirmedUserFactory()
        self.USERS = (self.user, self.unregistered, self.unconfirmed)

        factories.ProjectFactory(creator=self.user)
        self.project_with_unreg_contrib = factories.ProjectFactory()
        self.project_with_unreg_contrib.add_unregistered_contributor(
            fullname='Unreg',
            email=self.unregistered.username,
            auth=auth.Auth(self.project_with_unreg_contrib.creator))
        self.project_with_unreg_contrib.save()

        self.user.system_tags = ['shared', 'user']
        self.unconfirmed.system_tags = ['shared', 'unconfirmed']

        self.user.aka = ['shared', 'user']
        self.unconfirmed.aka = ['shared', 'unconfirmed']
Exemple #7
0
    def test_unconfirmed_emails_unregistered_user(self):

        assert_equal(factories.UnregUserFactory().unconfirmed_emails, [])
Exemple #8
0
 def test_unreg_users_dont_show_in_search(self):
     unreg = factories.UnregUserFactory()
     contribs = search.search_contributor(unreg.fullname)
     assert_equal(len(contribs['users']), 0)