示例#1
0
文件: tests.py 项目: 1e0ng/clickwork
    def setUp(self):
        u = User.objects.create_user("testuser_getnexttask", "*****@*****.**",
                                     "abc")
        u.full_clean()
        u.save()
        g = Group(name="test group")
        g.full_clean()
        g.save()
        u.groups.add(g)
        u.full_clean()
        u.save()

        p = Project(
            admin=u,
            title="Test Project",
            description="Testing project.",
            type="simple",
            annotator_count=1,
            priority=3,
        )
        p.full_clean()
        p.save()
        p.annotators.add(g)
        p.full_clean()
        p.save()
        t = SimpleTask(question="test question", project=p)
        t.full_clean()
        t.save()
        self.t = t
        self.user = u
示例#2
0
    def setUp(self):
        u = User.objects.create_user("testuser_getnexttask", "*****@*****.**", "abc")
        u.full_clean()
        u.save()
        g = Group(name="test group")
        g.full_clean()
        g.save()
        u.groups.add(g)
        u.full_clean()
        u.save()

        p = Project(
            admin=u, title="Test Project", description="Testing project.", type="simple", annotator_count=1, priority=3
        )
        p.full_clean()
        p.save()
        p.annotators.add(g)
        p.full_clean()
        p.save()
        t = SimpleTask(question="test question", project=p)
        t.full_clean()
        t.save()
        self.t = t
        self.user = u
示例#3
0
文件: tests.py 项目: 1e0ng/clickwork
    def setUp(self):
        u = User.objects.create_user("testuser_getnexttask", "*****@*****.**",
                                     "abc")
        u.full_clean()
        u.save()
        g = Group(name="test group")
        g.full_clean()
        g.save()
        u.groups.add(g)
        u.full_clean()
        u.save()

        p = SimpleProject(
            admin=u,
            title="Test Project",
            description="Testing project.",
            type="simple",
            annotator_count=1,
            priority=3,
        )
        p.full_clean()
        p.save()
        p.annotators.add(g)
        p.full_clean()
        p.save()
        t = SimpleTask(question="test question", project=p)
        t.full_clean()
        t.save()
        r = SimpleResponse(
            task=t,
            answer="test answer",
            comment="test comment",
            start_time=datetime.datetime(2000, 1, 1),
            user=u,
        )
        r.full_clean()
        r.save()
        t.completed_assignments = 1
        t.completed = True
        t.full_clean()
        t.save()
        self.t = t
        self.user = u
        self.p = p
示例#4
0
    def setUp(self):
        u = User.objects.create_user("testuser_getnexttask", "*****@*****.**", "abc")
        u.full_clean()
        u.save()
        g = Group(name="test group")
        g.full_clean()
        g.save()
        u.groups.add(g)
        u.full_clean()
        u.save()

        p = SimpleProject(
            admin=u, title="Test Project", description="Testing project.", type="simple", annotator_count=1, priority=3
        )
        p.full_clean()
        p.save()
        p.annotators.add(g)
        p.full_clean()
        p.save()
        t = SimpleTask(question="test question", project=p)
        t.full_clean()
        t.save()
        r = SimpleResponse(
            task=t, answer="test answer", comment="test comment", start_time=datetime.datetime(2000, 1, 1), user=u
        )
        r.full_clean()
        r.save()
        t.completed_assignments = 1
        t.completed = True
        t.full_clean()
        t.save()
        self.t = t
        self.user = u
        self.p = p