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()
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()
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)
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()
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()
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'])
def setUp(self): LucteriosTest.setUp(self) group = LucteriosGroup.objects.create( name="my_group") group.save() group = LucteriosGroup.objects.create( name="other_group") group.save()
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()
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'])
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)
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)
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='*****@*****.**'))
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="")
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()
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()
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)
def setUp(self): LucteriosTest.setUp(self) ourdetails = LegalEntity.objects.get(id=1) ourdetails.postal_code = "97400" ourdetails.save()
def setUp(self): LucteriosTest.setUp(self) add_empty_user()
def tearDown(self): self._del_plugin_dir() self.plugins = None PluginManager.free_instance() LucteriosTest.tearDown(self)
def setUp(self): signal_and_lock.unlocker_view_class = Unlock signal_and_lock.RecordLocker.clear() LucteriosTest.setUp(self) add_empty_user()
def __init__(self, methodName): LucteriosTest.__init__(self, methodName) self.xfer = None
def tearDown(self): LucteriosTest.tearDown(self) tools.WrapAction.mode_connect_notfree = parameters.notfree_mode_connect LucteriosAuditlogModelRegistry.set_state_packages([])
def tearDown(self): set_locale_lang('fr') activate(settings.LANGUAGE_CODE) LucteriosTest.tearDown(self)
def setUp(self): LucteriosTest.setUp(self) set_locale_lang('fr') activate(settings.LANGUAGE_CODE)
def tearDown(self): LucteriosTest.tearDown(self) LucteriosAuditlogModelRegistry.set_state_packages([])
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')
def setUp(self): LucteriosTest.setUp(self) default_groups()
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()
def setUp(self): LucteriosTest.setUp(self) rmtree(get_user_dir(), True) set_parameters( ["team", "activite", "age", "licence", "genre", 'numero', 'birth'])
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')
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()
def tearDown(self): LucteriosTest.tearDown(self) tools.WrapAction.mode_connect_notfree = parameters.notfree_mode_connect
def setUp(self): LucteriosTest.setUp(self) self._del_plugin_dir() PluginManager.free_instance() self.plugins = PluginManager.get_instance()
def setUp(self): self.xfer_class = XferContainerAcknowledge change_ourdetail() LucteriosTest.setUp(self) rmtree(get_user_dir(), True) self.server.start(1025)
def setUp(self): LucteriosTest.setUp(self) change_ourdetail() create_jack(add_empty_user()) rmtree(get_user_dir(), True)
def setUp(self): self.xfer_class = XferContainerAcknowledge LucteriosTest.setUp(self) add_empty_user()
def setUp(self): self.xfer_class = XferContainerAcknowledge LucteriosTest.setUp(self) rmtree(get_user_dir(), True) change_ourdetail()
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')
def tearDown(self): self.server.stop() LucteriosTest.tearDown(self)
def setUp(self): LucteriosTest.setUp(self)
def setUp(self): LucteriosTest.setUp(self) rmtree(get_user_dir(), True)
def setUp(self): initial_contacts() LucteriosTest.setUp(self) contact = Individual.objects.get(id=5) contact.user = add_user('joe') contact.save()
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')
def __init__(self, methodName): LucteriosTest.__init__(self, methodName) self.server = TestReceiver()