From 60f2a903e311d9616b44a231c8de7cfc1dfaf0ae Mon Sep 17 00:00:00 2001 From: Enrico Batista da Luz Date: Sun, 28 Apr 2024 11:24:10 +1000 Subject: [PATCH 1/3] Workaround limitation with pipenv action Using solution suggested on: https://github.com/VaultVulp/action-pipenv/issues/1 --- .github/workflows/test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 473e7c5..be22c11 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,15 +29,15 @@ jobs: - name: Display Python version run: python -c "import sys; print(sys.version)" - - name: Install dependecies - uses: VaultVulp/action-pipenv@v2.0.1 - with: - command: install --dev + - name: Install pipenv + run: pip install --user pipenv + + - name: Install all dependencies, including development ones + run: pipenv sync --dev - name: Install Django run: pip install -q Django~=${{ matrix.django-version }} - name: Test - uses: VaultVulp/action-pipenv@v2.0.1 with: - command: run test + command: pipenv run test From 2df63a78d53edba8aa8db74eb6b071cbd1a316ac Mon Sep 17 00:00:00 2001 From: Enrico Batista da Luz Date: Sun, 28 Apr 2024 11:26:14 +1000 Subject: [PATCH 2/3] Fix test workflow format --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index be22c11..d7873fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,5 +39,4 @@ jobs: run: pip install -q Django~=${{ matrix.django-version }} - name: Test - with: - command: pipenv run test + run: pipenv run test From c300707fa71cd456857f609f5cec0577ae703921 Mon Sep 17 00:00:00 2001 From: Enrico Batista da Luz Date: Sun, 28 Apr 2024 11:35:20 +1000 Subject: [PATCH 3/3] Fix bytes / string comparison in test --- testproject/tests/test_crypto_instance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testproject/tests/test_crypto_instance.py b/testproject/tests/test_crypto_instance.py index e250b9d..d4f0501 100644 --- a/testproject/tests/test_crypto_instance.py +++ b/testproject/tests/test_crypto_instance.py @@ -9,8 +9,9 @@ class TestCryptoInstance(TestCase): def test_should_have_a_default_secret_key(self): - self.assertEqual(crypto.key, 'MY_SECURE_KEY') - self.assertEqual(crypto.key, conf.THUMBOR_SECURITY_KEY) + key = crypto.key.decode('utf-8') + self.assertEqual(key, 'MY_SECURE_KEY') + self.assertEqual(key, conf.THUMBOR_SECURITY_KEY) @override_settings(THUMBOR_SECURITY_KEY='custom-security-key') def test_should_read_key_from_settings(self):