Exemple #1
0
    def test_message(self):
        c = Config()
        c.key = 'site_notice'
        c.value = 'ET Sighted.'
        c.save()

        if ('site_notice', ) in _config_cache:
            del _config_cache[('site_notice', )]

        r = self.client.get(reverse('home'), follow=True)
        doc = pq(r.content)
        eq_(doc('#site-notice').text(), 'ET Sighted.')

        c.delete()

        del _config_cache[('site_notice', )]

        r = self.client.get(reverse('home'), follow=True)
        doc = pq(r.content)
        eq_(len(doc('#site-notice')), 0)
Exemple #2
0
    def test_message(self):
        c = Config()
        c.key = 'site_notice'
        c.value = 'ET Sighted.'
        c.save()

        if ('site_notice',) in _config_cache:
            del _config_cache[('site_notice',)]

        r = self.client.get(reverse('home'), follow=True)
        doc = pq(r.content)
        eq_(doc('#site-notice').text(), 'ET Sighted.')

        c.delete()

        del _config_cache[('site_notice',)]

        r = self.client.get(reverse('home'), follow=True)
        doc = pq(r.content)
        eq_(len(doc('#site-notice')), 0)
Exemple #3
0
    def test_message(self):
        c = Config()
        c.key = "site_notice"
        c.value = "ET Sighted."
        c.save()

        if ("site_notice",) in _config_cache:
            del _config_cache[("site_notice",)]

        r = self.client.get(reverse("home"), follow=True)
        doc = pq(r.content)
        eq_(doc("#site-notice").text(), "ET Sighted.")

        c.delete()

        del _config_cache[("site_notice",)]

        r = self.client.get(reverse("home"), follow=True)
        doc = pq(r.content)
        eq_(len(doc("#site-notice")), 0)