Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor attachment class #234

Merged
merged 19 commits into from
Jun 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More unit test updates
SchrodingersGat committed Jun 11, 2024
commit 4f210ad311e6cc96f1a7e567001258eb33a33d8f
3 changes: 2 additions & 1 deletion test/test_build.py
Original file line number Diff line number Diff line change
@@ -70,7 +70,8 @@ def test_build_attachment(self):

response = build.uploadAttachment(fn, comment='A self referencing upload!')

self.assertEqual(response['build'], build.pk)
self.assertEqual(response['model_type'], 'build')
self.assertEqual(response['model_id'], build.pk)
self.assertEqual(response['comment'], 'A self referencing upload!')

self.assertEqual(len(build.getAttachments()), n + 1)
5 changes: 3 additions & 2 deletions test/test_order.py
Original file line number Diff line number Diff line change
@@ -384,7 +384,7 @@ def test_po_attachment(self):
po.uploadAttachment('not_found.txt')

# Check that attachments uploaded OK
attachments = po.getAttachments(self.api)
attachments = po.getAttachments()
self.assertEqual(len(attachments), 3)


@@ -519,7 +519,8 @@ def test_so_attachment(self):

attachment = Attachment(self.api, pk=pk)

self.assertEqual(attachment.order, so.pk)
self.assertEqual(attachment.modeL_type, 'salesorder')
self.assertEqual(attachment.model_id, so.pk)
self.assertEqual(attachment.comment, 'Sales order attachment')

attachments = so.getAttachments()