Skip to content

Commit

Permalink
Attempt to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
James Bligh committed Sep 30, 2023
1 parent eff54f8 commit ee269cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions tests/test_legacy_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from unittest import mock

from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase

Expand Down
10 changes: 5 additions & 5 deletions tests/test_rest_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class APNSDeviceSerializerTestCase(TestCase):
def test_validation(self):
# valid data - 32 bytes upper case
# valid data - 64 bytes upper case
serializer = APNSDeviceSerializer(data={
"registration_id": "AEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE",
"name": "Apple iPhone 6+",
Expand All @@ -20,7 +20,7 @@ def test_validation(self):
})
self.assertTrue(serializer.is_valid())

# valid data - 32 bytes lower case
# valid data - 64 bytes lower case
serializer = APNSDeviceSerializer(data={
"registration_id": "aeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeae",
"name": "Apple iPhone 6+",
Expand All @@ -31,23 +31,23 @@ def test_validation(self):

# valid data - 100 bytes upper case
serializer = APNSDeviceSerializer(data={
"registration_id": "AE" * 100,
"registration_id": "AE" * 50,
"name": "Apple iPhone 6+",
"device_id": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
})
self.assertTrue(serializer.is_valid())

# valid data - 100 bytes lower case
serializer = APNSDeviceSerializer(data={
"registration_id": "ae" * 100,
"registration_id": "ae" * 50,
"name": "Apple iPhone 6+",
"device_id": "ffffffffffffffffffffffffffffffff",
})
self.assertTrue(serializer.is_valid())

# valid data - 200 bytes mixed case
serializer = APNSDeviceSerializer(data={
"registration_id": "aE" * 200,
"registration_id": "aE" * 100,
"name": "Apple iPhone 6+",
"device_id": "ffffffffffffffffffffffffffffffff",
})
Expand Down

0 comments on commit ee269cd

Please sign in to comment.