Пример #1
0
    def test_some_profiles_synced(self):
        self._create_external_users(9)

        # Simulate 1 profile already synced
        username = '******'.format(TEST_USER_PREFIX)
        profile = pi_api.userprofile.create(username=username, approve=True)
        record_last_sync(profile)
        self._check_profiles_synced({profile.getId()})

        self._call_view_under_test()
        self._check_profiles_synced(self._get_member_ids())
        self._check_sync_dates()
Пример #2
0
    def test_some_profiles_synced(self):
        self._create_external_users(9)

        # Simulate 1 profile already synced
        username = '******'.format(TEST_USER_PREFIX)
        profile = pi_api.userprofile.create(username=username,
                                            approve=True)
        record_last_sync(profile)
        self._check_profiles_synced({profile.getId()})

        self._call_view_under_test()
        self._check_profiles_synced(self._get_member_ids())
        self._check_sync_dates()
Пример #3
0
    def test_all_profiles_synced(self):
        for n in range(3):
            username = '******'.format(TEST_USER_PREFIX, n)
            profile = pi_api.userprofile.create(username=username,
                                                approve=True)
            record_last_sync(profile)

        sync_dt = datetime.utcnow()
        self._call_view_under_test()
        self._check_profiles_synced([], sync_dt)

        # Simulate a new remote user being added
        sync_dt = datetime.utcnow()
        userid = self._create_external_user(3)
        self._call_view_under_test()
        self._check_profiles_synced({userid}, since=sync_dt)
        self._check_sync_dates()
Пример #4
0
    def test_all_profiles_synced(self):
        for n in range(3):
            username = '******'.format(TEST_USER_PREFIX, n)
            profile = pi_api.userprofile.create(username=username,
                                                approve=True)
            record_last_sync(profile)

        sync_dt = datetime.utcnow()
        self._call_view_under_test()
        self._check_profiles_synced([], sync_dt)

        # Simulate a new remote user being added
        sync_dt = datetime.utcnow()
        userid = self._create_external_user(3)
        self._call_view_under_test()
        self._check_profiles_synced({userid}, since=sync_dt)
        self._check_sync_dates()