API: Upload new version of an extension #138
@ -100,3 +100,18 @@ class VersionUploadAPITest(APITestCase):
|
|||||||
|
|
||||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||||
self.assertEqual(Version.objects.filter(extension=self.extension).count(), 2)
|
self.assertEqual(Version.objects.filter(extension=self.extension).count(), 2)
|
||||||
|
|
||||||
|
def test_date_last_access(self):
|
||||||
|
self.assertIsNone(self.token.date_last_access)
|
||||||
|
with open(self.file_path, 'rb') as version_file:
|
||||||
|
response = self.client.post(
|
||||||
|
self._get_upload_url(self.extension.extension_id),
|
||||||
|
{
|
||||||
|
'version_file': version_file,
|
||||||
|
'release_notes': 'These are the release notes',
|
||||||
|
},
|
||||||
|
format='multipart',
|
||||||
|
HTTP_AUTHORIZATION=f'Bearer {self.token_key}',
|
||||||
|
)
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||||
|
self.assertIsNotNone(self.token.date_last_access)
|
||||||
|
Loading…
Reference in New Issue
Block a user