Exemplo n.º 1
0
 def setUp(self):
     super(AnnouncementModelTests, self).setUp()
     self.creator = user(save=True)
     profile(user=self.creator)
     self.group = group(save=True)
     self.locale = locale(locale='es', save=True)
     self.creator.groups.add(self.group)
Exemplo n.º 2
0
 def setUp(self):
     super(AddRemoveReviewerTests, self).setUp()
     self.locale = locale(locale='es', save=True)
     self.user = user(save=True)
     self.locale.leaders.add(self.user)
     self.reviewer = user(save=True)
     self.client.login(username=self.user.username, password='******')
Exemplo n.º 3
0
 def setUp(self):
     super(AddRemoveLeaderTests, self).setUp()
     self.locale = locale(locale='es', save=True)
     self.user = user(save=True)
     add_permission(self.user, Locale, 'change_locale')
     self.leader = user(save=True)
     self.client.login(username=self.user.username, password='******')
Exemplo n.º 4
0
    def setUp(self):
        self.locale = locale(save=True, locale='es')

        self.u = user(save=True)

        self.locale.leaders.add(self.u)
        self.locale.save()

        self.announcement = announcement(save=True, creator=self.u,
            locale=self.locale, content="Look at me!",
            show_after=datetime(2012, 01, 01, 0, 0, 0))
Exemplo n.º 5
0
    def setUp(self):
        self.locale = locale(save=True, locale='es')

        self.u = user(save=True)

        self.locale.leaders.add(self.u)
        self.locale.save()

        self.announcement = announcement(save=True,
                                         creator=self.u,
                                         locale=self.locale,
                                         content="Look at me!",
                                         show_after=datetime(
                                             2012, 01, 01, 0, 0, 0))
Exemplo n.º 6
0
    def test_locale_list(self):
        """Verify the locale list renders all locales."""
        locale(locale='en-US', save=True)
        locale(locale='es', save=True)
        locale(locale='de', save=True)

        r = self.client.get(reverse('wiki.locales'))
        eq_(r.status_code, 200)
        doc = pq(r.content)
        eq_(3, len(doc('#locale-listing li')))
Exemplo n.º 7
0
    def setUp(self):
        self.locale1 = locale(save=True, locale='es')

        self.u1 = user(save=True)
        self.u2 = user(save=True)
        self.u3 = user(save=True)

        self.u1.is_superuser = 1
        self.u1.save()

        self.locale1.leaders.add(self.u2)
        self.locale1.save()

        self.announcement = announcement(save=True, creator=self.u2,
            locale=self.locale1, content="Look at me!",
            show_after=datetime(2012, 01, 01, 0, 0, 0))
Exemplo n.º 8
0
    def setUp(self):
        self.locale1 = locale(save=True, locale='es')

        self.u1 = user(save=True)
        self.u2 = user(save=True)
        self.u3 = user(save=True)

        self.u1.is_superuser = 1
        self.u1.save()

        self.locale1.leaders.add(self.u2)
        self.locale1.save()

        self.announcement = announcement(save=True, creator=self.u2,
            locale=self.locale1, content="Look at me!",
            show_after=datetime(2012, 01, 01, 0, 0, 0))
Exemplo n.º 9
0
    def test_locale_list(self):
        """Verify the locale list renders all locales."""
        l = locale(locale='es', save=True)
        leader = user(save=True)
        l.leaders.add(leader)
        reviewer = user(save=True)
        l.reviewers.add(reviewer)
        editor = user(save=True)
        l.editors.add(editor)

        r = self.client.get(reverse('wiki.locale_details', args=[l.locale]))
        eq_(r.status_code, 200)
        doc = pq(r.content)
        leaders = doc('ul.leaders > li')
        eq_(1, len(leaders))
        assert leader.username in leaders.text()
        reviewers = doc('ul.reviewers > li')
        eq_(1, len(reviewers))
        assert reviewer.username in reviewers.text()
        editors = doc('ul.editors > li')
        eq_(1, len(editors))
        assert editor.username in editors.text()
Exemplo n.º 10
0
 def setUp(self):
     self.locale = locale(save=True, locale='es')
Exemplo n.º 11
0
 def setUp(self):
     self.locale = locale(save=True, locale='es')