Пример #1
0
 def test_mail_notify_new_argument(self):
     hugo = create_user("hugo")
     hugo.email = "*****@*****.**"
     hugo.profile.wants_mail_notification = True
     hugo.save()
     max = create_user("max")
     max.email = "*****@*****.**"
     max.profile.wants_mail_notification = True
     max.save()
     berta = create_user("berta")
     berta.email = "*****@*****.**"
     berta.profile.wants_mail_notification = False
     berta.save()
     post = create_post('System Message', hugo)
     node = create_nodes_for_path('/foo.1', [hugo])
     create_vote(hugo, [node])
     create_vote(max, [node])
     create_vote(berta, [node])
     create_argument(node, 'n', 'Bla', 'Blubb', [hugo])
     notify_new_argument(node, post)
     self.assertEqual(len(mail.outbox), 1)
     m = mail.outbox[0]
     self.assertEqual(m.to, [])
     self.assertEqual(m.bcc, ['*****@*****.**', '*****@*****.**'])
     self.assertIn('System Message', m.body)
     self.assertGreater(len(m.subject), 0)
Пример #2
0
 def setUp(self):
     self.max = create_user('max')
     self.root = get_root_node()
     self.bla = create_slot("Bla")
     self.root.append_child(self.bla)
     self.bla1 = create_structureNode('Bla ist Bla',"Das musste gesagt werden.",[self.max])
     self.bla.append_child(self.bla1)
     self.blubb = create_slot("Blubb")
     self.bla1.append_child(self.blubb)
     self.blubb1 = create_textNode("Blubb ist eins", "Gesagt ist gedacht.", [self.max])
     self.blubb.append_child(self.blubb1)
     self.blubb2 = create_textNode("Blubb die Zweite", "Geschrieben ist notiert.", [self.max])
     self.blubb.append_child(self.blubb2)
     self.blubb2d = create_textNode("Blubb die Zweite", "Geschrieben ist anders notiert.", [self.max])
     self.blubb.append_child(self.blubb2d)
     self.blubb2.add_derivate(create_argument(), self.blubb2d)
     self.bla2 = create_textNode("Follopp", "Globbern!", [self.max])
     self.bla.append_child(self.bla2)
     self.bla2.add_derivate(create_argument(), self.blubb2)
     self.bla3 = create_textNode("Folloppiii", "Globbern! Den ganzen Tag.", [self.max])
     self.bla.append_child(self.bla3)
     self.blubb2.add_derivate(create_argument(), self.bla3)
     self.bla4 = create_textNode("Flop", "Glob!", [self.max])
     self.bla.append_child(self.bla4)
     self.bla3.add_derivate(create_argument(), self.bla4)
Пример #3
0
 def test_get_unfollows_counts_votes_from_multiple_sources_only_once(self):
     n1 = create_structureNode('Foo1')
     n2 = create_structureNode('Foo2')
     d = create_structureNode('Foo12')
     n1.add_derivate(create_argument(), d)
     n2.add_derivate(create_argument(), d)
     create_vote(self.hans, [n1, n2])
     self.assertEqual(d.get_unfollows(), 1)
Пример #4
0
def store_argument(path, arg_text, arg_type, author):
    node = get_node_for_path(path)
    title, arg_text = backend.split_title_from_text(arg_text)
    original_argument = create_argument(node, arg_type, title, arg_text,
                                        [author])
    # add auto follow
    create_vote(author, [original_argument])
    # copy argument for all derivates
    for d in node.traverse_derivates():
        new_argument = create_argument(d, arg_type, title, arg_text, [author])
        original_argument.add_derivate(new_argument)
    return path + "." + arg_type + "." + str(node.arguments.count())
Пример #5
0
    def setUp(self):
        self.hans = create_user('hans')
        self.hugo = create_user('hugo')

        self.root = get_root_node()
        self.slot1 = create_slot('Wahlprogramm')
        self.root.append_child(self.slot1)
        self.structureNode1 = create_structureNode('LangerWahlprogrammTitel',
                                                   authors=[self.hans])
        self.slot1.append_child(self.structureNode1)
        self.slot11 = create_slot('Transparenz')
        self.structureNode1.append_child(self.slot11)
        self.textnode11 = create_textNode('Traaaansparenz',
                                          authors=[self.hans])
        self.slot11.append_child(self.textnode11)
        self.slot12 = create_slot('Bildung')
        self.structureNode1.append_child(self.slot12)
        self.textnode12 = create_textNode('Biiildung', authors=[self.hans])
        self.slot12.append_child(self.textnode12)
        self.slot13 = create_slot('Datenschutz')
        self.structureNode1.append_child(self.slot13)
        self.textnode13 = create_textNode('Daaatenschutz', authors=[self.hans])
        self.slot13.append_child(self.textnode13)

        self.arguments = []
        for i in range(1, 25):
            arg = create_argument(self.textnode11, 'p', "Argument" + str(i),
                                  "Text of argument no. " + str(i),
                                  [self.hugo, self.hans])
            create_vote(self.hugo, [arg])
            if i % 2 == 1:
                create_vote(self.hans, [arg])
                create_spam_flag(self.hugo, [arg])
            self.arguments.append(arg)
Пример #6
0
 def test_get_unfollows_with_2_unfollows_returns_2(self):
     n = create_structureNode('Foo')
     n2 = create_structureNode('Foo2')
     n.add_derivate(create_argument(), n2)
     create_vote(self.hans, [n])
     create_vote(self.hugo, [n])
     self.assertEqual(n2.get_unfollows(), 2)
Пример #7
0
 def test_get_unfollows_on_node_with_same_votes_than_source_returns_0(self):
     n = create_structureNode('Foo')
     n2 = create_structureNode('Foo2')
     n.add_derivate(create_argument(), n2)
     create_vote(self.hans, [n, n2])
     create_vote(self.hugo, [n, n2])
     self.assertEqual(n2.get_unfollows(), 0)
Пример #8
0
 def setUp(self):
     self.root = get_root_node()
     self.hugo = create_user("Hugo", password="******", groups=['voters'])
     self.ulf = create_user("Ulf", password="******", groups=['voters'])
     self.permela = create_user("Permela", password="******")
     self.slot = create_slot("Slot")
     self.root.append_child(self.slot)
     self.text = create_textNode("Bla", "Blubb", [self.hugo])
     self.slot.append_child(self.text)
     self.mid = create_textNode("Bla derivate", "Blubb2", [self.hugo])
     self.slot.append_child(self.mid)
     self.text.add_derivate(self.mid, arg_type='c', title="dagegen")
     self.leaf1 = create_textNode("Bla leaf 1", "Blubb3", [self.hugo])
     self.slot.append_child(self.leaf1)
     self.mid.add_derivate(self.leaf1, arg_type='c', title="dagegen2")
     self.mid2 = create_textNode("Bla derivate 2", "Blubb4", [self.hugo])
     self.slot.append_child(self.mid2)
     self.mid.add_derivate(self.mid2, arg_type='c', title="dagegen")
     self.leaf2 = create_textNode("Bla leaf 2", "Blubb5", [self.hugo])
     self.slot.append_child(self.leaf2)
     self.mid2.add_derivate(self.leaf2, arg_type='c', title="dagegen")
     self.follow = create_vote(self.hugo,
                               [self.text, self.mid, self.leaf1, self.mid2,
                                self.leaf2])
     self.arg1 = create_argument(self.text, "con", "Wrong!", "Bad!",
                                 [self.hugo])
Пример #9
0
 def test_get_newfollows_does_count_votes_and_not_users(self):
     n = create_structureNode('Foo')
     n2 = create_structureNode('Foo2')
     n.add_derivate(create_argument(), n2)
     create_vote(self.hans, [n])
     create_vote(self.hans, [n2])
     self.assertEqual(n2.get_newfollows(), 1)
Пример #10
0
 def test_get_newfollows_with_a_newfollow_returns_1(self):
     n = create_structureNode('Foo')
     n2 = create_structureNode('Foo2')
     n.add_derivate(create_argument(), n2)
     create_vote(self.hans, [n2])
     create_vote(self.hugo, [n, n2])
     self.assertEqual(n2.get_newfollows(), 1)
Пример #11
0
    def test_add_derivate_copies_arguments(self):
        s = create_structureNode("Source", authors=[self.hans])
        self.foo.append_child(s)
        d = create_structureNode("Derivate", authors=[self.hans])
        self.foo.append_child(d)
        a = create_argument(s, arg_type='p', title="myArg", text="cool",
                            authors=[self.hugo])
        self.assertEqual(s.arguments.count(), 1)
        self.assertEqual(s.arguments.all()[0], a)
        s.add_derivate(d, arg_type='c', title="yourArg", text="ument",
                       authors=[self.hans])
        self.assertEqual(s.arguments.count(), 2)
        sa1, sa2 = s.arguments.order_by('index')
        self.assertEqual(sa1, a)
        self.assertEqual(sa2.arg_type, 'c')
        self.assertEqual(sa2.title, 'yourArg')
        self.assertEqual(sa2.text.text, 'ument')
        self.assertEqual(sa2.text.authors.count(), 1)
        self.assertIn(self.hans, sa2.text.authors.all())

        self.assertEqual(d.arguments.count(), 1)
        da1, = d.arguments.order_by('index')
        self.assertEqual(da1.arg_type, 'p')
        self.assertEqual(da1.title, 'myArg')
        self.assertEqual(da1.text.text, 'cool')
        self.assertEqual(da1.text.authors.count(), 1)
        self.assertIn(self.hugo, da1.text.authors.all())
Пример #12
0
 def setUp(self):
     self.root = get_root_node()
     self.hugo = create_user("Hugo", password="******", groups=['voters'])
     self.ulf = create_user("Ulf", password="******", groups=['voters'])
     self.permela = create_user("Permela", password="******")
     self.slot = create_slot("Slot")
     self.root.append_child(self.slot)
     self.text = create_textNode("Bla", "Blubb", [self.hugo])
     self.slot.append_child(self.text)
     self.mid = create_textNode("Bla derivate", "Blubb2", [self.hugo])
     self.slot.append_child(self.mid)
     self.text.add_derivate(self.mid, arg_type='c', title="dagegen")
     self.leaf1 = create_textNode("Bla leaf 1", "Blubb3", [self.hugo])
     self.slot.append_child(self.leaf1)
     self.mid.add_derivate(self.leaf1, arg_type='c', title="dagegen2")
     self.mid2 = create_textNode("Bla derivate 2", "Blubb4", [self.hugo])
     self.slot.append_child(self.mid2)
     self.mid.add_derivate(self.mid2, arg_type='c', title="dagegen")
     self.leaf2 = create_textNode("Bla leaf 2", "Blubb5", [self.hugo])
     self.slot.append_child(self.leaf2)
     self.mid2.add_derivate(self.leaf2, arg_type='c', title="dagegen")
     self.follow = create_vote(
         self.hugo,
         [self.text, self.mid, self.leaf1, self.mid2, self.leaf2])
     self.arg1 = create_argument(self.text, "con", "Wrong!", "Bad!",
                                 [self.hugo])
Пример #13
0
    def setUp(self):
        self.hans = create_user('hans')
        self.hugo = create_user('hugo')

        self.root = get_root_node()
        self.slot1 = create_slot('Wahlprogramm')
        self.root.append_child(self.slot1)
        self.structureNode1 = create_structureNode('LangerWahlprogrammTitel',
                                                   authors=[self.hans])
        self.slot1.append_child(self.structureNode1)
        self.slot11 = create_slot('Transparenz')
        self.structureNode1.append_child(self.slot11)
        self.textnode11 = create_textNode('Traaaansparenz', authors=[self.hans])
        self.slot11.append_child(self.textnode11)
        self.slot12 = create_slot('Bildung')
        self.structureNode1.append_child(self.slot12)
        self.textnode12 = create_textNode('Biiildung', authors=[self.hans])
        self.slot12.append_child(self.textnode12)
        self.slot13 = create_slot('Datenschutz')
        self.structureNode1.append_child(self.slot13)
        self.textnode13 = create_textNode('Daaatenschutz', authors=[self.hans])
        self.slot13.append_child(self.textnode13)

        self.arguments = []
        for i in range(1, 25):
            arg = create_argument(self.textnode11, 'p', "Argument" + str(i),
                                  "Text of argument no. " + str(i), [self.hugo, self.hans])
            create_vote(self.hugo, [arg])
            if i % 2 == 1:
                create_vote(self.hans, [arg])
                create_spam_flag(self.hugo, [arg])
            self.arguments.append(arg)
Пример #14
0
 def setUp(self):
     self.hugo = create_user('hugo')
     # create nodes
     self.root = get_root_node()
     self.foo = create_slot('foo')
     self.root.append_child(self.foo)
     self.foo1 = create_structureNode('FooooBar')
     self.foo.append_child(self.foo1)
     # add arguments
     self.foo_pro = create_argument(type='pro', text="weils geil ist", authors=[self.hugo])
     self.foo1.append_argument(self.foo_pro)
     self.foo_neut = create_argument(type='neut', text="kann noch geiler werden", authors=[self.hugo])
     self.foo1.append_argument(self.foo_neut)
     self.foo_con = create_argument(type='con', text="is aber leider root", authors=[self.hugo])
     self.foo1.append_argument(self.foo_con)
     # summary variables
     self.foo_arguments = [self.foo_pro, self.foo_neut, self.foo_con]
Пример #15
0
    def test_creating_an_argument_adds_to_path_cache(self):
        slot = create_slot('Foo')
        self.root.append_child(slot)
        sn = create_structureNode("Foobarbaz1")
        slot.append_child(sn)

        a = create_argument(sn, arg_type='con')
        node_a = Node.objects.get(id=a.id)
        self.assertEqual(node_a, PathCache.objects.get(path='Foo.1.con.1').node)
Пример #16
0
 def setUp(self):
     self.hugo = create_user('hugo')
     self.hans = create_user('hans')
     # create nodes
     self.root = get_root_node()
     self.foo = create_slot('foo')
     self.foo1 = create_structureNode('FooooBar')
     # add arguments
     self.foo_pro = create_argument(type='pro', title="geil", authors=[self.hugo])
     self.foo1.append_argument(self.foo_pro)
     self.foo_neut = create_argument(type='neut', title="ist", authors=[self.hans])
     self.foo1.append_argument(self.foo_neut)
     self.foo_con = create_argument(type='con', title="geiz", authors=[self.hugo, self.hans])
     self.foo1.append_argument(self.foo_con)
     # summary variables
     self.foo_arguments = [self.foo_pro, self.foo_neut, self.foo_con]
     self.arg_titles = ['geil', 'ist', 'geiz']
     self.arg_authors = [[self.hugo], [self.hans], [self.hugo, self.hans]]
Пример #17
0
 def setUp(self):
     self.hugo = create_user('hugo')
     self.hans = create_user('hans')
     # create nodes
     self.root = get_root_node()
     self.foo = create_slot('foo')
     self.root.append_child(self.foo)
     self.foo1 = create_structureNode('FooooBar')
     self.foo.append_child(self.foo1)
     # add arguments
     self.foo_pro = create_argument(self.foo1, arg_type='pro', title="geil",
                                    authors=[self.hugo])
     self.foo_neut = create_argument(self.foo1, arg_type='neut',
                                     title="ist", authors=[self.hans])
     self.foo_con = create_argument(self.foo1, arg_type='con', title="geiz",
                                    authors=[self.hugo, self.hans])
     # summary variables
     self.foo_arguments = [self.foo_pro, self.foo_neut, self.foo_con]
     self.arg_titles = ['geil', 'ist', 'geiz']
     self.arg_authors = [[self.hugo], [self.hans], [self.hugo, self.hans]]
Пример #18
0
    def setUp(self):
        self.hans = create_user('hans')
        self.hugo = create_user('hugo')

        self.root = get_root_node()
        self.slot1 = create_slot('Wahlprogramm')
        self.root.append_child(self.slot1)
        self.textnode1 = create_textNode('LangerWahlprogrammTitel', authors=[self.hans])
        self.slot1.append_child(self.textnode1)
        self.slot2 = create_slot('Grundsatzprogramm')
        self.root.append_child(self.slot2)
        self.textnode2 = create_textNode('LangerGrundsatzTitel', authors=[self.hugo])
        self.slot2.append_child(self.textnode2)
        self.slot3 = create_slot('Organisatorisches')
        self.root.append_child(self.slot3)
        self.textnode31 = create_textNode('Langweilig1', authors=[self.hans])
        self.textnode32 = create_textNode('Langweilig2', authors=[self.hugo])
        self.textnode33 = create_textNode('Langweilig3', authors=[self.hans, self.hugo])
        self.slot3.append_child(self.textnode31)
        self.slot3.append_child(self.textnode32)
        self.textnode32d = create_textNode('Langweilig2 anders', authors=[self.hans, self.hugo])
        self.slot3.append_child(self.textnode32d)
        self.textnode32.add_derivate(create_argument(),self.textnode32d)
        create_vote(self.hans, [self.textnode32, self.textnode32d])
        self.slot3.append_child(self.textnode33)
        create_vote(self.hans, [self.textnode33])
        self.textnode33d = create_textNode('Langweilig3 anders', authors=[self.hans, self.hugo])
        self.slot3.append_child(self.textnode33d)
        self.textnode33.add_derivate(create_argument(),self.textnode33d)
        self.nodes = [self.textnode31, self.textnode32, self.textnode32d, self.textnode33, self.textnode33d]
        self.authorGroups = [[create_user_info(self.hans)], [create_user_info(self.hugo)],
                             [create_user_info(self.hans), create_user_info(self.hugo)],
                             [create_user_info(self.hans), create_user_info(self.hugo)],
                             [create_user_info(self.hans), create_user_info(self.hugo)]]
        self.follows = [0, 1, 1, 1, 0]
        self.unFollows = [0, 0, 0, 0, 1]
        self.newFollows = [0, 1, 0, 1, 0]
        self.originGroups = [[], [], ['Organisatorisches.2'], [], ['Organisatorisches.4']]
Пример #19
0
 def setUp(self):
     self.hugo = create_user('hugo')
     # create nodes
     self.root = get_root_node()
     self.foo = create_slot('foo')
     self.root.append_child(self.foo)
     self.foo1 = create_structureNode('FooooBar')
     self.foo.append_child(self.foo1)
     # add arguments
     self.foo_pro = create_argument(self.foo1,
                                    arg_type='pro',
                                    text="weils geil ist",
                                    authors=[self.hugo])
     self.foo_neut = create_argument(self.foo1,
                                     arg_type='neut',
                                     text="kann noch geiler werden",
                                     authors=[self.hugo])
     self.foo_con = create_argument(self.foo1,
                                    arg_type='con',
                                    text="is aber leider root",
                                    authors=[self.hugo])
     # summary variables
     self.foo_arguments = [self.foo_pro, self.foo_neut, self.foo_con]
Пример #20
0
    def test_add_derivate(self):
        n = create_structureNode("Source", authors=[self.hans])
        d = create_structureNode("Derivate", authors=[self.hans])
        a = create_argument()
        n.add_derivate(a, d)


        self.assertIn(d, n.derivates.all())
        self.assertIn(n, d.sources.all())

        no = Derivation.objects.filter(source=n, derivate=d)
        self.assertTrue(no.count() == 1)
        self.assertEqual(no[0].argument, a)

        self.assertIn(no[0], n.derivative_order_set.all())
        self.assertIn(no[0], d.source_order_set.all())
Пример #21
0
    def setUp(self):
        self.horst = create_user('horst')
        self.udo = create_user('udo')

        self.root = get_root_node()
        self.slot1 = create_slot('soon_empty')
        self.root.append_child(self.slot1)
        self.node = create_structureNode('To be or not to be', 'never both')
        self.slot1.append_child(self.node)
        self.arg = create_argument(self.node, 'c', "no", "lyrics")
        self.path = 'soon_empty.1'
        self.child_slot = create_slot('or_to_pee')
        self.node.append_child(self.child_slot)
        self.child = create_structureNode('or to pee')
        self.child_slot.append_child(self.child)

        TextCache.objects.create(path=self.path, paragraphs="doesn't matter")
        IndexCache.objects.create(path=self.path, index_nodes="doesn't matter")

        self.slot2 = create_slot('verfassungswiedrig')
        self.root.append_child(self.slot2)
        self.source = create_structureNode('BöserTitel', 'gewöhnlicher text')
        self.slot2.append_child(self.source)
        self.derivate = create_structureNode('BöserTitel',
                                             'verfassungswiedriger text')
        self.slot2.append_child(self.derivate)
        self.source.add_derivate(self.derivate, arg_type='con',
                                 title="zuSchwach", text="muss fieser werden",
                                 authors=[self.udo])

        self.source_path = 'verfassungswiedrig.1'
        self.derivate_path = 'verfassungswiedrig.2'

        create_vote(self.udo, [self.node])
        create_vote(self.horst, [self.source, self.node])
        create_spam_flag(self.horst, [self.node])

        create_post('i reference /verfassungswiedrig.1 because i like it ',
                    self.horst, self.path)
Пример #22
0
 def test_post_new_generic_argument_for_node_message(self):
     hugo = create_user('Hugo')
     node = create_nodes_for_path('/bla.1/blubb.1', [hugo])
     argument = create_argument(node, Argument.PRO, 'Argumentutinio',
                                'Arrgumente!', [hugo])
     post = post_new_argument_for_node_message(hugo, '/bla.1/blubb.1',
                                               Argument.PRO,
                                               '/bla.1/blubb.1.pro.1')
     self.assertEqual(post.author, get_system_user())
     self.assertEqual(post.location, node)
     self.assertEqual(post.post_type, Post.ARGUMENT_CREATED)
     self.assertIn(hugo, post.mentions.all())
     self.assertIn(node, post.node_references.all())
     self.assertIn(argument.pk, [a.pk for a in post.node_references.all()])
     self.assertEqual(post.node_references.count(), 2)
     self.assertEqual(
         post.text_cache, u'<span style="color: gray;">Hinweis:</span> ' +
         u'<a href="/user/Hugo">@Hugo</a> hat dem Vorschlag '
         u'<a href="/bla.1/blubb.1">blubb_long'
         u'<span class="nodeIndex">1</span></a> das Argument ' +
         u'<a href="/bla.1/blubb.1.pro.1">Argumentutinio'
         u'<span class="nodeIndex">1</span></a> hinzugefügt.')
Пример #23
0
 def test_post_new_generic_argument_for_node_message(self):
     hugo = create_user('Hugo')
     node = create_nodes_for_path('/bla.1/blubb.1', [hugo])
     argument = create_argument(node, Argument.PRO, 'Argumentutinio',
                                'Arrgumente!', [hugo])
     post = post_new_argument_for_node_message(hugo, '/bla.1/blubb.1',
                                               Argument.PRO,
                                               '/bla.1/blubb.1.pro.1')
     self.assertEqual(post.author, get_system_user())
     self.assertEqual(post.location, node)
     self.assertEqual(post.post_type, Post.ARGUMENT_CREATED)
     self.assertIn(hugo, post.mentions.all())
     self.assertIn(node, post.node_references.all())
     self.assertIn(argument.pk, [a.pk for a in post.node_references.all()])
     self.assertEqual(post.node_references.count(), 2)
     self.assertEqual(
         post.text_cache,
         u'<span style="color: gray;">Hinweis:</span> ' +
         u'<a href="/user/Hugo">@Hugo</a> hat dem Vorschlag '
         u'<a href="/bla.1/blubb.1">blubb_long'
         u'<span class="nodeIndex">1</span></a> das Argument ' +
         u'<a href="/bla.1/blubb.1.pro.1">Argumentutinio'
         u'<span class="nodeIndex">1</span></a> hinzugefügt.')
Пример #24
0
    def setUp(self):
        self.hans = create_user('hans')
        self.hugo = create_user('hugo')

        self.root = get_root_node()
        self.slot1 = create_slot('Wahlprogramm')
        self.root.append_child(self.slot1)
        self.structureNode1 = create_structureNode(
            'LangerWahlprogrammTitel',
            text="Einleitungstext",
            authors=[self.hans])
        self.slot1.append_child(self.structureNode1)
        self.slot11 = create_slot('Transparenz')
        self.structureNode1.append_child(self.slot11)
        self.structureNode11 = create_structureNode(
            'Traaaansparenz',
            text="Transparenz ist wichtig.",
            authors=[self.hans])
        self.slot11.append_child(self.structureNode11)
        self.slot111 = create_slot('Ebene_3')
        self.structureNode11.append_child(self.slot111)
        self.structureNode111 = create_structureNode(
            'Eeeebeneee 3',
            authors=[self.hans])
        self.slot111.append_child(self.structureNode111)
        self.slot1111 = create_slot('Ebene_4')
        self.structureNode111.append_child(self.slot1111)
        self.structureNode1111 = create_structureNode(
            'Eeeebeneee 4',
            authors=[self.hans])
        self.slot1111.append_child(self.structureNode1111)
        self.slot11111 = create_slot('Ebene_5')
        self.structureNode1111.append_child(self.slot11111)
        self.structureNode11111 = create_structureNode(
            'Eeeebeneee 5',
            authors=[self.hans])
        self.slot11111.append_child(self.structureNode11111)
        self.slot111111 = create_slot('Ebene_6')
        self.structureNode11111.append_child(self.slot111111)
        self.structureNode111111 = create_structureNode(
            'Eeeebeneee 6',
            authors=[self.hans])
        self.slot111111.append_child(self.structureNode111111)
        self.slot1111111 = create_slot('Ebene_7')
        self.structureNode111111.append_child(self.slot1111111)
        self.textnode1111111 = create_textNode(
            'Traaaansparenz',
            text="Auf Ebene 7.",
            authors=[self.hans])
        self.slot1111111.append_child(self.textnode1111111)
        self.slot12 = create_slot('Bildung')
        self.structureNode1.append_child(self.slot12)
        self.textnode12 = create_textNode(
            'Biiildung',
            authors=[self.hans])
        self.slot12.append_child(self.textnode12)
        self.slot13 = create_slot('Datenschutz')
        self.structureNode1.append_child(self.slot13)
        self.textnode13 = create_textNode(
            'Daaatenschutz', text="Blubb.", authors=[self.hans])
        self.slot13.append_child(self.textnode13)
        self.textnode13_a1 = create_argument(
            self.textnode13, arg_type='con', title='Dagegen',
            text="...denn ihr seid dafür", authors=[self.hugo])

        self.slot2 = create_slot('Grundsatzprogramm')
        self.root.append_child(self.slot2)
        self.textnode2 = create_textNode(
            'LangerGrundsatzTitel', authors=[self.hugo])
        self.slot2.append_child(self.textnode2)

        self.slot3 = create_slot('Organisatorisches')
        self.root.append_child(self.slot3)
        self.textnode31 = create_textNode('Langweilig1', authors=[self.hans])
        self.textnode32 = create_textNode('Langweilig2', authors=[self.hugo])
        self.textnode33 = create_textNode(
            'Langweilig3', authors=[self.hans, self.hugo])
        self.slot3.append_child(self.textnode31)
        self.slot3.append_child(self.textnode32)
        self.slot3.append_child(self.textnode33)
        create_vote(self.hans, [self.textnode33])

        self.top_slots = [self.slot1, self.slot2, self.slot3]
        self.child_slots = [self.slot11, self.slot12, self.slot13]
        self.short_titles = ['Wahlprogramm', 'Grundsatzprogramm',
                             'Organisatorisches']
        self.full_titles = ['LangerWahlprogrammTitel', 'LangerGrundsatzTitel',
                            'Langweilig3']
        self.authors = [[self.hans], [self.hugo], [self.hans, self.hugo]]
        self.maxDiff = None
Пример #25
0
    def setUp(self):
        self.hans = create_user('hans')
        self.hugo = create_user('hugo')

        self.root = get_root_node()
        self.slot1 = create_slot('Wahlprogramm')
        self.root.append_child(self.slot1)
        self.structureNode1 = create_structureNode('LangerWahlprogrammTitel',
                                                   text="Einleitungstext",
                                                   authors=[self.hans])
        self.slot1.append_child(self.structureNode1)
        self.slot11 = create_slot('Transparenz')
        self.structureNode1.append_child(self.slot11)
        self.structureNode11 = create_structureNode(
            'Traaaansparenz',
            text="Transparenz ist wichtig.",
            authors=[self.hans])
        self.slot11.append_child(self.structureNode11)
        self.slot111 = create_slot('Ebene_3')
        self.structureNode11.append_child(self.slot111)
        self.structureNode111 = create_structureNode('Eeeebeneee 3',
                                                     authors=[self.hans])
        self.slot111.append_child(self.structureNode111)
        self.slot1111 = create_slot('Ebene_4')
        self.structureNode111.append_child(self.slot1111)
        self.structureNode1111 = create_structureNode('Eeeebeneee 4',
                                                      authors=[self.hans])
        self.slot1111.append_child(self.structureNode1111)
        self.slot11111 = create_slot('Ebene_5')
        self.structureNode1111.append_child(self.slot11111)
        self.structureNode11111 = create_structureNode('Eeeebeneee 5',
                                                       authors=[self.hans])
        self.slot11111.append_child(self.structureNode11111)
        self.slot111111 = create_slot('Ebene_6')
        self.structureNode11111.append_child(self.slot111111)
        self.structureNode111111 = create_structureNode('Eeeebeneee 6',
                                                        authors=[self.hans])
        self.slot111111.append_child(self.structureNode111111)
        self.slot1111111 = create_slot('Ebene_7')
        self.structureNode111111.append_child(self.slot1111111)
        self.textnode1111111 = create_textNode('Traaaansparenz',
                                               text="Auf Ebene 7.",
                                               authors=[self.hans])
        self.slot1111111.append_child(self.textnode1111111)
        self.slot12 = create_slot('Bildung')
        self.structureNode1.append_child(self.slot12)
        self.textnode12 = create_textNode('Biiildung', authors=[self.hans])
        self.slot12.append_child(self.textnode12)
        self.slot13 = create_slot('Datenschutz')
        self.structureNode1.append_child(self.slot13)
        self.textnode13 = create_textNode('Daaatenschutz',
                                          text="Blubb.",
                                          authors=[self.hans])
        self.slot13.append_child(self.textnode13)
        self.textnode13_a1 = create_argument(self.textnode13,
                                             arg_type='con',
                                             title='Dagegen',
                                             text="...denn ihr seid dafür",
                                             authors=[self.hugo])

        self.slot2 = create_slot('Grundsatzprogramm')
        self.root.append_child(self.slot2)
        self.textnode2 = create_textNode('LangerGrundsatzTitel',
                                         authors=[self.hugo])
        self.slot2.append_child(self.textnode2)

        self.slot3 = create_slot('Organisatorisches')
        self.root.append_child(self.slot3)
        self.textnode31 = create_textNode('Langweilig1', authors=[self.hans])
        self.textnode32 = create_textNode('Langweilig2', authors=[self.hugo])
        self.textnode33 = create_textNode('Langweilig3',
                                          authors=[self.hans, self.hugo])
        self.slot3.append_child(self.textnode31)
        self.slot3.append_child(self.textnode32)
        self.slot3.append_child(self.textnode33)
        create_vote(self.hans, [self.textnode33])

        self.top_slots = [self.slot1, self.slot2, self.slot3]
        self.child_slots = [self.slot11, self.slot12, self.slot13]
        self.short_titles = [
            'Wahlprogramm', 'Grundsatzprogramm', 'Organisatorisches'
        ]
        self.full_titles = [
            'LangerWahlprogrammTitel', 'LangerGrundsatzTitel', 'Langweilig3'
        ]
        self.authors = [[self.hans], [self.hugo], [self.hans, self.hugo]]
        self.maxDiff = None