Esempio n. 1
0
    def setUp(self):
        LucteriosTest.setUp(self)

        rmtree(get_user_dir(), True)
        current_user = add_empty_user()
        current_user.is_superuser = False
        current_user.save()
        group = LucteriosGroup.objects.create(name="my_group")
        group.save()
        group = LucteriosGroup.objects.create(name="other_group")
        group.save()
        self.factory.user = LucteriosUser.objects.get(username='******')
        self.factory.user.groups.set(LucteriosGroup.objects.filter(id__in=[2]))
        self.factory.user.user_permissions.set(Permission.objects.all())
        self.factory.user.save()

        folder1 = Folder.objects.create(name='truc1', description='blabla')
        folder1.viewer.set(LucteriosGroup.objects.filter(id__in=[1, 2]))
        folder1.modifier.set(LucteriosGroup.objects.filter(id__in=[1]))
        folder1.save()
        folder2 = Folder.objects.create(name='truc2', description='bouuuuu!')
        folder2.viewer.set(LucteriosGroup.objects.filter(id__in=[2]))
        folder2.modifier.set(LucteriosGroup.objects.filter(id__in=[2]))
        folder2.save()
        folder3 = Folder.objects.create(name='truc3', description='----')
        folder3.parent = folder2
        folder3.viewer.set(LucteriosGroup.objects.filter(id__in=[2]))
        folder3.save()
        folder4 = Folder.objects.create(name='truc4', description='no')
        folder4.parent = folder2
        folder4.save()
Esempio n. 2
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     group = LucteriosGroup.objects.create(name="my_group")
     group.save()
     group = LucteriosGroup.objects.create(name="other_group")
     group.save()
Esempio n. 3
0
 def setUp(self):
     tools.WrapAction.mode_connect_notfree = None
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     signal_and_lock.unlocker_view_class = Unlock
     signal_and_lock.RecordLocker.clear()
     add_empty_user()
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     initial_thirds()
     LucteriosTest.setUp(self)
     default_compta()
     rmtree(get_user_dir(), True)
     fill_entries(1)
Esempio n. 5
0
    def setUp(self):
        self.xfer_class = XferContainerAcknowledge
        LucteriosTest.setUp(self)

        rmtree(get_user_dir(), True)
        current_user = add_empty_user()
        current_user.is_superuser = False
        current_user.save()
        group = LucteriosGroup.objects.create(name="my_group")
        group.save()
        group = LucteriosGroup.objects.create(name="other_group")
        group.save()
        self.factory.user = LucteriosUser.objects.get(username='******')
        self.factory.user.groups = LucteriosGroup.objects.filter(id__in=[2])
        self.factory.user.user_permissions = Permission.objects.all()
        self.factory.user.save()

        folder1 = Folder.objects.create(name='truc1', description='blabla')
        folder1.viewer = LucteriosGroup.objects.filter(id__in=[1, 2])
        folder1.modifier = LucteriosGroup.objects.filter(id__in=[1])
        folder1.save()
        folder2 = Folder.objects.create(name='truc2', description='bouuuuu!')
        folder2.viewer = LucteriosGroup.objects.filter(id__in=[2])
        folder2.modifier = LucteriosGroup.objects.filter(id__in=[2])
        folder2.save()
        folder3 = Folder.objects.create(name='truc3', description='----')
        folder3.parent = folder2
        folder3.viewer = LucteriosGroup.objects.filter(id__in=[2])
        folder3.save()
        folder4 = Folder.objects.create(name='truc4', description='no')
        folder4.parent = folder2
        folder4.save()
Esempio n. 6
0
 def setUp(self):
     self.xfer_class.url_text = "customer/details"
     self.xfer_class.is_view_right = ''
     LucteriosTest.setUp(self)
     self.value = False
     self.xfer = XferContainerCustom()
     Params.clear()
Esempio n. 7
0
 def setUp(self):
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
     default_season()
     default_params()
     default_adherents()
     default_event_params()
     set_parameters(["team", "activite", "age", "licence", "genre", 'numero', 'birth'])
Esempio n. 8
0
 def setUp(self):
     LucteriosTest.setUp(self)
     group = LucteriosGroup.objects.create(
         name="my_group")
     group.save()
     group = LucteriosGroup.objects.create(
         name="other_group")
     group.save()
Esempio n. 9
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     self.xfer_class.url_text = "customer/details"
     self.xfer_class.is_view_right = ''
     LucteriosTest.setUp(self)
     self.value = False
     self.xfer = XferContainerCustom()
     Params.clear()
Esempio n. 10
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
     default_season()
     default_params()
     set_parameters(
         ["team", "activite", "age", "licence", "genre", 'numero', 'birth'])
Esempio n. 11
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     set_accounting_system()
     initial_thirds()
     default_compta()
     fill_entries(1)
     rmtree(get_user_dir(), True)
Esempio n. 12
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     initial_thirds()
     LucteriosTest.setUp(self)
     default_compta()
     default_costaccounting()
     default_bankaccount()
     default_setowner()
     rmtree(get_user_dir(), True)
Esempio n. 13
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     self.factory.user = AnonymousUser()
     change_ourdetail()
     create_jack(
         LucteriosUser.objects.create(first_name='jack',
                                      last_name='MISTER',
                                      username='******',
                                      email='*****@*****.**'))
Esempio n. 14
0
    def setUp(self):

        LucteriosTest.setUp(self)
        Example.objects.create(name='abc', value=12, price=1224.06,
                               date='1997-10-07', time='21:43', valid=True, comment="blablabla")
        Example.objects.create(name='zzzz', value=7, price=714.03,
                               date='2008-03-21', time='15:21', valid=False, comment="")
        Example.objects.create(name='uvw', value=9, price=918.05,
                               date='2014-05-11', time='04:57', valid=True, comment="")
        Example.objects.create(name='blabla', value=17, price=1734.08,
                               date='2001-07-17', time='23:14', valid=False, comment="")
        Example.objects.create(name='boom', value=4, price=408.02,
                               date='1984-08-02', time='11:36', valid=True, comment="")
Esempio n. 15
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
     default_financial()
     default_season()
     default_params()
     default_adherents()
     default_subscription()
     default_event_params()
     set_parameters(
         ["team", "activite", "age", "licence", "genre", 'numero', 'birth'])
     add_default_degree()
Esempio n. 16
0
    def setUp(self):
        LucteriosTest.setUp(self)
        if hasattr(settings, "ETHERPAD"):
            settings.ETHERPAD = {}
        if hasattr(settings, "ETHERCALC"):
            settings.ETHERCALC = {}

        rmtree(get_user_dir(), True)
        default_groups()
        default_folders()
        self.factory.user = LucteriosUser.objects.get(username='******')
        self.factory.user.groups.set(LucteriosGroup.objects.filter(id__in=[2]))
        self.factory.user.user_permissions.set(Permission.objects.all())
        self.factory.user.save()
Esempio n. 17
0
 def setUp(self):
     DocumentShow.url_text
     initial_thirds_fr()
     LucteriosTest.setUp(self)
     default_compta_fr(with12=False)
     default_bankaccount_fr()
     default_setowner_fr()
     contact = Individual.objects.get(id=5)
     contact.user = add_user('joe')
     contact.save()
     rmtree(get_user_dir(), True)
     add_years()
     init_compta()
     add_test_callfunds(False, True)
     add_test_expenses_fr(False, True)
Esempio n. 18
0
 def setUp(self):
     LucteriosTest.setUp(self)
     ourdetails = LegalEntity.objects.get(id=1)
     ourdetails.postal_code = "97400"
     ourdetails.save()
Esempio n. 19
0
 def setUp(self):
     LucteriosTest.setUp(self)
     add_empty_user()
Esempio n. 20
0
 def setUp(self):
     LucteriosTest.setUp(self)
     ourdetails = LegalEntity.objects.get(id=1)
     ourdetails.postal_code = "97400"
     ourdetails.save()
Esempio n. 21
0
 def tearDown(self):
     self._del_plugin_dir()
     self.plugins = None
     PluginManager.free_instance()
     LucteriosTest.tearDown(self)
Esempio n. 22
0
 def setUp(self):
     signal_and_lock.unlocker_view_class = Unlock
     signal_and_lock.RecordLocker.clear()
     LucteriosTest.setUp(self)
     add_empty_user()
Esempio n. 23
0
 def __init__(self, methodName):
     LucteriosTest.__init__(self, methodName)
     self.xfer = None
Esempio n. 24
0
 def tearDown(self):
     LucteriosTest.tearDown(self)
     tools.WrapAction.mode_connect_notfree = parameters.notfree_mode_connect
     LucteriosAuditlogModelRegistry.set_state_packages([])
Esempio n. 25
0
 def tearDown(self):
     set_locale_lang('fr')
     activate(settings.LANGUAGE_CODE)
     LucteriosTest.tearDown(self)
Esempio n. 26
0
 def setUp(self):
     LucteriosTest.setUp(self)
     set_locale_lang('fr')
     activate(settings.LANGUAGE_CODE)
Esempio n. 27
0
 def tearDown(self):
     LucteriosTest.tearDown(self)
     LucteriosAuditlogModelRegistry.set_state_packages([])
Esempio n. 28
0
    def test_concurentedit(self):
        user1 = add_user("user1")
        user1.is_superuser = True
        user1.save()
        grp = LucteriosGroup.objects.create(name="mygroup")
        grp.save()

        self.calljson('/CORE/authentification', {'username': '******', 'password': '******'})
        self.assert_observer('core.auth', 'CORE', 'authentification')
        self.assert_json_equal('', '', 'OK')

        self.calljson('/CORE/groupsEdit', {'group': '1'})
        self.assert_observer('core.custom', 'CORE', 'groupsEdit')
        self.assert_action_equal(self.response_json['close'], ('unlock', None, "CORE", "unlock", 1, 1, 1))
        self.assertEqual(len(self.json_context), 2)
        self.assertEqual(self.json_context["group"], '1')
        self.assertEqual(self.json_context["LOCK_IDENT"], 'lucterios.CORE.models-LucteriosGroup-1')

        new_test = LucteriosTest("setUp")
        new_test.setUp()
        new_test.calljson('/CORE/authentification', {'username': '******', 'password': '******'})
        new_test.assert_observer('core.auth', 'CORE', 'authentification')
        new_test.assert_json_equal('', '', 'OK')

        new_test.calljson('/CORE/groupsEdit', {'group': '1'})
        new_test.assert_observer('core.exception', 'CORE', 'groupsEdit')
        new_test.assert_json_equal('', 'message', six.text_type("Enregistrement verrouillé par 'admin'!"))
        new_test.assert_json_equal('', 'code', '3')

        self.calljson('/CORE/exitConnection', {})

        new_test.calljson('/CORE/groupsEdit', {'group': '1'})
        new_test.assert_observer('core.custom', 'CORE', 'groupsEdit')
Esempio n. 29
0
 def setUp(self):
     LucteriosTest.setUp(self)
     default_groups()
Esempio n. 30
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     signal_and_lock.unlocker_view_class = Unlock
     signal_and_lock.RecordLocker.clear()
     LucteriosTest.setUp(self)
     add_empty_user()
Esempio n. 31
0
 def setUp(self):
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
     set_parameters(
         ["team", "activite", "age", "licence", "genre", 'numero', 'birth'])
Esempio n. 32
0
    def test_concurentedit(self):
        user1 = add_user("user1")
        user1.is_superuser = True
        user1.save()

        self.call(
            '/CORE/authentification', {'username': '******', 'password': '******'})
        self.assert_observer('core.auth', 'CORE', 'authentification')
        self.assert_xml_equal('', 'OK')

        self.call('/CORE/usersEdit', {'user_actif': '3'})
        self.assert_observer('core.custom', 'CORE', 'usersEdit')
        self.assert_count_equal('CLOSE_ACTION/ACTION', 1)
        self.assert_action_equal(
            'CLOSE_ACTION/ACTION', ('unlock', None, "CORE", "unlock", 1, 1, 1))
        self.assert_count_equal('CONTEXT/PARAM', 2)
        self.assert_xml_equal('CONTEXT/PARAM[@name="user_actif"]', '3')
        self.assert_xml_equal(
            'CONTEXT/PARAM[@name="LOCK_IDENT"]', 'lucterios.CORE.models-LucteriosUser-3')

        new_test = LucteriosTest("setUp")
        new_test.setUp()
        new_test.call(
            '/CORE/authentification', {'username': '******', 'password': '******'})
        new_test.assert_observer('core.auth', 'CORE', 'authentification')
        new_test.assert_xml_equal('', 'OK')

        new_test.call('/CORE/usersEdit', {'user_actif': '3'})
        new_test.assert_observer('core.exception', 'CORE', 'usersEdit')
        new_test.assert_xml_equal(
            'EXCEPTION/MESSAGE', six.text_type("Enregistrement verrouillé par 'admin'!"))
        new_test.assert_xml_equal('EXCEPTION/CODE', '3')

        self.call(
            '/CORE/unlock', {'user_actif': '3', "LOCK_IDENT": 'lucterios.CORE.models-LucteriosUser-3'})
        self.assert_observer('core.acknowledge', 'CORE', 'unlock')

        new_test.call('/CORE/usersEdit', {'user_actif': '3'})
        new_test.assert_observer('core.custom', 'CORE', 'usersEdit')
Esempio n. 33
0
 def setUp(self):
     LucteriosTest.setUp(self)
     add_empty_user()
Esempio n. 34
0
 def setUp(self):
     tools.WrapAction.mode_connect_notfree = None
     LucteriosTest.setUp(self)
     signal_and_lock.unlocker_view_class = Unlock
     signal_and_lock.RecordLocker.clear()
     add_empty_user()
Esempio n. 35
0
 def tearDown(self):
     LucteriosTest.tearDown(self)
     tools.WrapAction.mode_connect_notfree = parameters.notfree_mode_connect
Esempio n. 36
0
 def __init__(self, methodName):
     LucteriosTest.__init__(self, methodName)
     self.xfer = None
Esempio n. 37
0
 def setUp(self):
     LucteriosTest.setUp(self)
     self._del_plugin_dir()
     PluginManager.free_instance()
     self.plugins = PluginManager.get_instance()
Esempio n. 38
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     change_ourdetail()
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
     self.server.start(1025)
Esempio n. 39
0
 def setUp(self):
     LucteriosTest.setUp(self)
     change_ourdetail()
     create_jack(add_empty_user())
     rmtree(get_user_dir(), True)
Esempio n. 40
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     add_empty_user()
Esempio n. 41
0
 def setUp(self):
     self.xfer_class = XferContainerAcknowledge
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
     change_ourdetail()
Esempio n. 42
0
 def setUp(self):
     signal_and_lock.unlocker_view_class = Unlock
     signal_and_lock.RecordLocker.clear()
     LucteriosTest.setUp(self)
     add_empty_user()
Esempio n. 43
0
 def setUp(self):
     LucteriosTest.setUp(self)
     change_ourdetail()
     create_jack(add_empty_user())
     rmtree(get_user_dir(), True)
Esempio n. 44
0
    def test_concurentedit(self):
        user1 = add_user("user1")
        user1.is_superuser = True
        user1.save()

        self.calljson('/CORE/authentification', {'username': '******', 'password': '******'})
        self.assert_observer('core.auth', 'CORE', 'authentification')
        self.assert_json_equal('', '', 'OK')

        self.calljson('/CORE/usersEdit', {'user_actif': '3'})
        self.assert_observer('core.custom', 'CORE', 'usersEdit')
        self.assertEqual(len(self.json_actions), 3)
        self.assert_action_equal(self.response_json['close'], ('unlock', None, "CORE", "unlock", 1, 1, 1))
        self.assertEqual(len(self.json_context), 2)
        self.assertEqual(self.json_context["user_actif"], '3')
        self.assertEqual(self.json_context["LOCK_IDENT"], 'lucterios.CORE.models-LucteriosUser-3')

        new_test = LucteriosTest("setUp")
        new_test.setUp()
        new_test.calljson('/CORE/authentification', {'username': '******', 'password': '******'})
        new_test.assert_observer('core.auth', 'CORE', 'authentification')
        new_test.assert_json_equal('', '', 'OK')

        new_test.calljson('/CORE/usersEdit', {'user_actif': '3'})
        new_test.assert_observer('core.exception', 'CORE', 'usersEdit')
        new_test.assert_json_equal('', 'message', six.text_type("Enregistrement verrouillé par 'admin'!"))
        new_test.assert_json_equal('', 'code', '3')

        self.calljson('/CORE/unlock', {'user_actif': '3', "LOCK_IDENT": 'lucterios.CORE.models-LucteriosUser-3'})
        self.assert_observer('core.acknowledge', 'CORE', 'unlock')

        new_test.calljson('/CORE/usersEdit', {'user_actif': '3'})
        new_test.assert_observer('core.custom', 'CORE', 'usersEdit')
Esempio n. 45
0
    def test_concurentedit(self):
        user1 = add_user("user1")
        user1.is_superuser = True
        user1.save()

        self.calljson('/CORE/authentification', {'username': '******', 'password': '******'})
        self.assert_observer('core.auth', 'CORE', 'authentification')
        self.assert_json_equal('', '', 'OK')

        self.calljson('/CORE/usersEdit', {'user_actif': '3'})
        self.assert_observer('core.custom', 'CORE', 'usersEdit')
        self.assertEqual(len(self.json_actions), 3)
        self.assert_action_equal(self.response_json['close'], ('unlock', None, "CORE", "unlock", 1, 1, 1))
        self.assertEqual(len(self.json_context), 2)
        self.assertEqual(self.json_context["user_actif"], '3')
        self.assertEqual(self.json_context["LOCK_IDENT"], 'lucterios.CORE.models-LucteriosUser-3')

        new_test = LucteriosTest("setUp")
        new_test.setUp()
        new_test.calljson('/CORE/authentification', {'username': '******', 'password': '******'})
        new_test.assert_observer('core.auth', 'CORE', 'authentification')
        new_test.assert_json_equal('', '', 'OK')

        new_test.calljson('/CORE/usersEdit', {'user_actif': '3'})
        new_test.assert_observer('core.exception', 'CORE', 'usersEdit')
        new_test.assert_json_equal('', 'message', six.text_type("Enregistrement verrouillé par 'admin'!"))
        new_test.assert_json_equal('', 'code', '3')

        self.calljson('/CORE/unlock', {'user_actif': '3', "LOCK_IDENT": 'lucterios.CORE.models-LucteriosUser-3'})
        self.assert_observer('core.acknowledge', 'CORE', 'unlock')

        new_test.calljson('/CORE/usersEdit', {'user_actif': '3'})
        new_test.assert_observer('core.custom', 'CORE', 'usersEdit')
Esempio n. 46
0
    def test_concurentedit(self):
        user1 = add_user("user1")
        user1.is_superuser = True
        user1.save()
        grp = LucteriosGroup.objects.create(name="mygroup")
        grp.save()

        self.calljson('/CORE/authentification', {'username': '******', 'password': '******'})
        self.assert_observer('core.auth', 'CORE', 'authentification')
        self.assert_json_equal('', '', 'OK')

        self.calljson('/CORE/groupsEdit', {'group': '1'})
        self.assert_observer('core.custom', 'CORE', 'groupsEdit')
        self.assert_action_equal(self.response_json['close'], ('unlock', None, "CORE", "unlock", 1, 1, 1))
        self.assertEqual(len(self.json_context), 2)
        self.assertEqual(self.json_context["group"], '1')
        self.assertEqual(self.json_context["LOCK_IDENT"], 'lucterios.CORE.models-LucteriosGroup-1')

        new_test = LucteriosTest("setUp")
        new_test.setUp()
        new_test.calljson('/CORE/authentification', {'username': '******', 'password': '******'})
        new_test.assert_observer('core.auth', 'CORE', 'authentification')
        new_test.assert_json_equal('', '', 'OK')

        new_test.calljson('/CORE/groupsEdit', {'group': '1'})
        new_test.assert_observer('core.exception', 'CORE', 'groupsEdit')
        new_test.assert_json_equal('', 'message', six.text_type("Enregistrement verrouillé par 'admin'!"))
        new_test.assert_json_equal('', 'code', '3')

        self.calljson('/CORE/exitConnection', {})

        new_test.calljson('/CORE/groupsEdit', {'group': '1'})
        new_test.assert_observer('core.custom', 'CORE', 'groupsEdit')
Esempio n. 47
0
 def tearDown(self):
     self.server.stop()
     LucteriosTest.tearDown(self)
Esempio n. 48
0
    def setUp(self):

        LucteriosTest.setUp(self)
Esempio n. 49
0
 def setUp(self):
     LucteriosTest.setUp(self)
     rmtree(get_user_dir(), True)
Esempio n. 50
0
    def setUp(self):

        LucteriosTest.setUp(self)
Esempio n. 51
0
 def tearDown(self):
     LucteriosTest.tearDown(self)
     tools.WrapAction.mode_connect_notfree = parameters.notfree_mode_connect
Esempio n. 52
0
 def setUp(self):
     initial_contacts()
     LucteriosTest.setUp(self)
     contact = Individual.objects.get(id=5)
     contact.user = add_user('joe')
     contact.save()
Esempio n. 53
0
    def test_concurentedit(self):
        user1 = add_user("user1")
        user1.is_superuser = True
        user1.save()
        grp = LucteriosGroup.objects.create(
            name="mygroup")
        grp.save()

        self.call(
            '/CORE/authentification', {'username': '******', 'password': '******'})
        self.assert_observer('core.auth', 'CORE', 'authentification')
        self.assert_xml_equal('', 'OK')

        self.call('/CORE/groupsEdit', {'group': '1'})
        self.assert_observer('core.custom', 'CORE', 'groupsEdit')
        self.assert_count_equal('CLOSE_ACTION/ACTION', 1)
        self.assert_action_equal(
            'CLOSE_ACTION/ACTION', ('unlock', None, "CORE", "unlock", 1, 1, 1))
        self.assert_count_equal('CONTEXT/PARAM', 2)
        self.assert_xml_equal('CONTEXT/PARAM[@name="group"]', '1')
        self.assert_xml_equal(
            'CONTEXT/PARAM[@name="LOCK_IDENT"]', 'lucterios.CORE.models-LucteriosGroup-1')

        new_test = LucteriosTest("setUp")
        new_test.setUp()
        new_test.call(
            '/CORE/authentification', {'username': '******', 'password': '******'})
        new_test.assert_observer('core.auth', 'CORE', 'authentification')
        new_test.assert_xml_equal('', 'OK')

        new_test.call('/CORE/groupsEdit', {'group': '1'})
        new_test.assert_observer('core.exception', 'CORE', 'groupsEdit')
        new_test.assert_xml_equal(
            'EXCEPTION/MESSAGE', six.text_type("Enregistrement verrouillé par 'admin'!"))
        new_test.assert_xml_equal('EXCEPTION/CODE', '3')

        self.call('/CORE/exitConnection', {})

        new_test.call('/CORE/groupsEdit', {'group': '1'})
        new_test.assert_observer('core.custom', 'CORE', 'groupsEdit')
Esempio n. 54
0
 def __init__(self, methodName):
     LucteriosTest.__init__(self, methodName)
     self.server = TestReceiver()