コード例 #1
0
    def after_update(self):
        # checks if there is new applications and update all the user
        # profiles on the system
        store = new_store()
        update_profile_applications(store)

        # Updating the parameter list
        sysparam.ensure_system_parameters(store, update=True)
        store.commit(close=True)
コード例 #2
0
ファイル: migration.py プロジェクト: romaia/stoq
    def after_update(self):
        # checks if there is new applications and update all the user
        # profiles on the system
        store = new_store()
        update_profile_applications(store)
        store.commit(close=True)

        # Updating the parameter list
        ensure_system_parameters(update=True)
コード例 #3
0
    def test_update_profile_applications(self):
        profile = UserProfile(store=self.store, name=u'assistant')

        profile.add_application_reference(u'stock', has_permission=True)
        items = profile.profile_settings
        assert len(list(items)) == 1

        new_profile = UserProfile(store=self.store, name=u'assistant')
        update_profile_applications(self.store, new_profile)
        items = new_profile.profile_settings
コード例 #4
0
ファイル: test_profile.py プロジェクト: romaia/stoq
    def test_update_profile_applications(self):
        profile = UserProfile(store=self.store, name=u'assistant')

        profile.add_application_reference(u'stock',
                                          has_permission=True)
        items = profile.profile_settings
        assert len(list(items)) == 1

        new_profile = UserProfile(store=self.store, name=u'assistant')
        update_profile_applications(self.store, new_profile)
        items = new_profile.profile_settings