Пример #1
0
    def tmpl_alert_email_record(self, recid=0, xml_record=None):
        """ Format a single record."""

        if recid != 0:
            out = wrap_records(get_as_text(record_id=recid))
            out += "\nDetailed record: <%s/%s/%s>" % (CFG_SITE_URL, CFG_SITE_RECORD, recid)
        elif xml_record:
            out = wrap_records(get_as_text(xml_record=xml_record))
            # TODO: add Detailed record url for external records?
        return out
Пример #2
0
    def tmpl_alert_email_record(self, recid=0, xml_record=None):
        """ Format a single record."""

        if recid != 0:
            out = wrap_records(get_as_text(record_id=recid))
            out += "\nDetailed record: <%s/record/%s>" % (CFG_SITE_URL, recid)
        elif xml_record:
            out = wrap_records(get_as_text(xml_record=xml_record))
            # TODO: add Detailed record url for external records?
        return out
Пример #3
0
    def test_your_alerts_pages_availability(self):
        """webalert - HTML to text conversion"""

        self.assertEqual(
            "High energy cosmic rays striking atoms at the top of the atmosphere give the rise to showers of particles striking the Earth's surface \nDes rayons cosmiques de haute energie heurtent des atomes dans la haute atmosphere et donnent ainsi naissance a des gerbes de particules projetees sur la surface terrestre \n10 May 1999 \nPicture number: CERN-DI-9905005",
            get_as_text(5))

        self.assertEqual(
            "Quasinormal modes of Reissner-Nordstrom Anti-de Sitter Black Holes / Wang, B ; Lin, C Y ; Abdalla, E [hep-th/0003295] \nComplex frequencies associated with quasinormal modes for large Reissner-Nordstr$\\ddot{o}$m Anti-de Sitter black holes have been computed. [...] \nPublished in Phys. Lett., B :481 2000 79-88",
            get_as_text(74))
    def test_your_alerts_pages_availability(self):
        """webalert - HTML to text conversion"""
        from invenio.htmlparser import get_as_text

        out = get_as_text(5)
        self.assertIn(
            "High energy cosmic rays striking atoms at the top of the atmosphere give the rise to showers of particles striking the Earth's surface",
            out)
        self.assertIn(
            "Des rayons cosmiques de haute energie heurtent des atomes dans la haute atmosphere et donnent ainsi naissance a des gerbes de particules projetees sur la surface terrestre",
            out)
        self.assertIn("CERN-DI-9905005", out)

        out = get_as_text(74)
        self.assertIn(
            "Quasinormal modes of Reissner-Nordstrom Anti-de Sitter Black Holes",
            out)
        self.assertIn("hep-th/0003295", out)
        self.assertIn(
            "Complex frequencies associated with quasinormal modes for large Reissner-Nordstr$\\ddot{o}$m Anti-de Sitter black holes have been computed.",
            out)
        self.assertIn("Phys. Lett., B :481 2000 79-88", out)
    def test_your_alerts_pages_availability(self):
        """webalert - HTML to text conversion"""

        self.assertEqual("High energy cosmic rays striking atoms at the top of the atmosphere give the rise to showers of particles striking the Earth's surface \nDes rayons cosmiques de haute energie heurtent des atomes dans la haute atmosphere et donnent ainsi naissance a des gerbes de particules projetees sur la surface terrestre \n10 May 1999 \nPicture number: CERN-DI-9905005", get_as_text(5))

        self.assertEqual("Quasinormal modes of Reissner-Nordstrom Anti-de Sitter Black Holes / Wang, B ; Lin, C Y ; Abdalla, E [hep-th/0003295] \nComplex frequencies associated with quasinormal modes for large Reissner-Nordstr$\\ddot{o}$m Anti-de Sitter black holes have been computed. [...] \nPublished in Phys. Lett., B :481 2000 79-88", get_as_text(74))