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)
def test_lowercase(self): jnumber = parse_jnumber("j:1234") expected = "J:1234" self.assertEqual(expected, jnumber)
def test_jnumber_without_colon(self): jnumber = parse_jnumber("J1234") expected = "J:1234" self.assertEqual(expected, jnumber)
def test_numeric_value(self): jnumber = parse_jnumber("1234") expected = "J:1234" self.assertEqual(expected, jnumber)
def test_empty_input(self): jnumber = parse_jnumber("") expected = "" self.assertEqual(expected, jnumber)