Ejemplo n.º 1
0
 def get_by_jnumber(self, jnumber):
     """
     Retrieve a single reference by jnumber (without J: prefix)
     returns SmallReference
     """
     jnum_id = parse_jnumber(jnumber)
     reference = self.get_by_jnum_id(jnum_id)
     return convert_models(reference, SmallReference)
Ejemplo n.º 2
0
 def test_lowercase(self):
     jnumber = parse_jnumber("j:1234")
     expected = "J:1234"
     self.assertEqual(expected, jnumber)
Ejemplo n.º 3
0
 def test_jnumber_without_colon(self):
     jnumber = parse_jnumber("J1234")
     expected = "J:1234"
     self.assertEqual(expected, jnumber)
Ejemplo n.º 4
0
 def test_numeric_value(self):
     jnumber = parse_jnumber("1234")
     expected = "J:1234"
     self.assertEqual(expected, jnumber)
Ejemplo n.º 5
0
 def test_empty_input(self):
     jnumber = parse_jnumber("")
     expected = ""
     self.assertEqual(expected, jnumber)