2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

Remove reliance on django-markdownx (#3231)

* Remove reliance on django-markdownx

- We are now rendering notes on the client side using easymde
- No longer any need to utilize the markdownx integration
- Adds character limit for notes fields`

* Adjust legacy migrations - remove references to markdownx

* Fix bug for company notes field
This commit is contained in:
Oliver
2022-06-20 22:20:04 +10:00
committed by GitHub
parent a8b71d7d9e
commit 63b4ff3eb6
32 changed files with 173 additions and 110 deletions

View File

@ -1305,6 +1305,22 @@ class PartDetailTests(InvenTreeAPITestCase):
self.assertFalse('hello' in part.metadata)
self.assertEqual(part.metadata['x'], 'y')
def test_part_notes(self):
"""Unit tests for the part 'notes' field"""
# Ensure that we cannot upload a very long piece of text
url = reverse('api-part-detail', kwargs={'pk': 1})
response = self.patch(
url,
{
'notes': 'abcde' * 10001
},
expected_code=400
)
self.assertIn('Ensure this field has no more than 50000 characters', str(response.data['notes']))
class PartAPIAggregationTest(InvenTreeAPITestCase):
"""Tests to ensure that the various aggregation annotations are working correctly..."""