Skip to content

Commit baeb49a

Browse files
committed
Fixed tests
1 parent 80913ef commit baeb49a

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

telegram/passport/passportdata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def de_json(cls, data, bot):
5656

5757
data = super(PassportData, cls).de_json(data, bot)
5858
data['data'] = EncryptedPassportElement.de_list(data.get('data'), bot)
59-
data['credentials'] = EncryptedCredentials
59+
data['credentials'] = EncryptedCredentials.de_json(data.get('credentials'), bot)
6060

6161
return cls(bot=bot, **data)
6262

tests/test_passportdata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def test_expected_values(self, passport_data):
4040
def test_de_json(self, bot):
4141
json_dict = {'data': [data.to_dict() for data in self.data],
4242
'credentials': self.credentials.to_dict()}
43+
print("CREDENTIALS:")
44+
print(self.credentials.to_dict())
4345
passport_data = PassportData.de_json(json_dict, bot)
4446

4547
assert isinstance(passport_data.data, list)

tests/test_passportelementerrordatafield.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_equality(self):
7373
assert a is not b
7474

7575
assert a != c
76-
assert hash(a) == hash(c)
76+
assert hash(a) != hash(c)
7777

7878
assert a != d
7979
assert hash(a) != hash(d)

tests/test_passportelementerrorfiles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_equality(self):
6161
c = PassportElementErrorFiles(self.type, '', '')
6262
d = PassportElementErrorFiles('', self.file_hashes, '')
6363
e = PassportElementErrorFiles('', '', self.message)
64-
f = PassportElementErrorSelfie(self.type, self.file_hashes, self.message)
64+
f = PassportElementErrorSelfie(self.type, '', self.message)
6565

6666
assert a == b
6767
assert hash(a) == hash(b)

0 commit comments

Comments
 (0)