13 lines
304 B
Python
13 lines
304 B
Python
from django.test import TestCase
|
|
|
|
# Create your tests here.
|
|
import time
|
|
import hashlib
|
|
import json
|
|
def md5(st):
|
|
h1 = hashlib.md5()
|
|
h1.update(st.encode(encoding = 'utf-8'))
|
|
return h1.hexdigest()
|
|
|
|
data = {'user_id': 1, 'company_id': 1, 'expire': time.time() + 3600}
|
|
print(md5(json.dumps(data))) |