Skip to content

Commit

Permalink
Add markup attribute to Note objects in json.
Browse files Browse the repository at this point in the history
  • Loading branch information
koenedaele committed Aug 13, 2015
1 parent cfd50c0 commit fb211c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

- Sort case insensitive when sorting by label. This is a BC break, although
to most users it might actually be a bug fix. (#16) [TalissaJoly]
- Add the markup attribute to Note json representations. This is a new addition
to skosprovider 0.6.0 that allows marking that a note contains some markup
(currently only HTML).

0.6.0 (2015-03-02)
------------------
Expand Down
3 changes: 2 additions & 1 deletion pyramid_skosprovider/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def note_adapter(obj, request):
return {
'note': obj.note,
'type': obj.type,
'language': obj.language
'language': obj.language,
'markup': obj.markup
}

json_renderer.add_adapter(Concept, concept_adapter)
Expand Down
1 change: 1 addition & 0 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def test_get_conceptschemes_trees_species_json(self):
self.assertIn('id', data)
self.assertIn('label', data)
self.assertIn('labels', data)
self.assertIn('notes', data)
self.assertEqual('collection', data['type'])
self.assertNotIn('narrower', data)
self.assertNotIn('broader', data)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def test_json_concept(self):
self.assertIn('note', n)
self.assertIn('type', n)
self.assertIn('language', n)
self.assertIn('markup', n)
self.assertIsInstance(concept['broader'], list)
self.assertIsInstance(concept['related'], list)
self.assertIsInstance(concept['narrower'], list)
Expand Down Expand Up @@ -181,4 +182,5 @@ def test_json_collection(self):
self.assertIn('note', n)
self.assertIn('type', n)
self.assertIn('language', n)
self.assertIn('markup', n)
assert 'matches' not in coll

0 comments on commit fb211c0

Please sign in to comment.