API: Upload new version of an extension #138

Merged
Dalai Felinto merged 12 commits from tokens-version-api into main 2024-05-27 16:18:05 +02:00
Showing only changes of commit 26bfe61f53 - Show all commits

View File

@ -29,6 +29,20 @@ class VersionUploadAPITest(APITestCase):
self.upload_url = reverse('extensions:upload-extension-version') self.upload_url = reverse('extensions:upload-extension-version')
self.file_path = TEST_FILES_DIR / "amaranth-1.0.8.zip" self.file_path = TEST_FILES_DIR / "amaranth-1.0.8.zip"
def test_version_upload_unauthenticated(self):
with open(self.file_path, 'rb') as version_file:
response = self.client.post(
self.upload_url,
{
'version_file': version_file,
'extension_id': self.extension.extension_id,
'release_notes': 'These are the release notes',
},
format='multipart',
)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_version_upload_extension_not_maintained_by_user(self): def test_version_upload_extension_not_maintained_by_user(self):
other_user = UserFactory() other_user = UserFactory()
dfelinto marked this conversation as resolved Outdated

how does this part work now? we are not keeping a token field on the object anymore as far as i can tell

how does this part work now? we are not keeping a `token` field on the object anymore as far as i can tell
other_extension = create_approved_version( other_extension = create_approved_version(