Skip to content

Commit 241842c

Browse files
theparadoxer02sourabhtk37
authored andcommitted
modified testcases
1 parent ea65292 commit 241842c

File tree

6 files changed

+13
-22
lines changed

6 files changed

+13
-22
lines changed

code_share/.cache/v/cache/lastfailed

-7
This file was deleted.

code_share/app_code_share/tests/test_models.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
from test_plus.test import TestCase
22
from app_code_share.models import CodeShare
3-
import random
3+
from django.utils.crypto import get_random_string
4+
45

56

67
class TestCodeShare(TestCase):
78

89
def setUp(self):
910
self.code_share = 'testcode'
10-
self.a = random.randrange(0, 6)
11-
self.hash_value = str(hash(self.code_share))[self.a:self.a + 8]
11+
self.chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
12+
self.hash_value = get_random_string(8, self.chars)
1213
self.file_name = 'testfilename'
1314

1415
CodeShare.objects.create(

code_share/app_code_share/tests/test_urls.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
from django.core.urlresolvers import reverse, resolve
22
from test_plus.test import TestCase
33
from app_code_share.models import CodeShare
4-
import random
4+
from django.utils.crypto import get_random_string
55

66

7-
class TestUserURLs(TestCase):
8-
"""TEST URL PATTER FOR BLOG APP"""
7+
8+
class TestCodeShare(TestCase):
99

1010
def setUp(self):
1111
self.code_share = 'testcode'
12-
self.a = random.randrange(0, 6)
13-
self.hash_value = str(hash(self.code_share))[self.a:self.a + 8]
12+
self.chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
13+
self.hash_value = get_random_string(8, self.chars)
1414
self.file_name = 'testfilename'
1515

1616
CodeShare.objects.create(

code_share/app_code_share/tests/test_views.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from test_plus.test import TestCase
22
from app_code_share.models import CodeShare
3-
import random
3+
from django.utils.crypto import get_random_string
44

55

6-
class CodeShareTests(TestCase):
6+
class TestCodeShare(TestCase):
77

88
def setUp(self):
99
self.code_share = 'testcode'
10-
self.a = random.randrange(0, 6)
11-
self.hash_value = str(hash(self.code_share))[self.a:self.a + 8]
10+
self.chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
11+
self.hash_value = get_random_string(8, self.chars)
1212
self.file_name = 'testfilename'
1313

1414
CodeShare.objects.create(

code_share/code_share/settings.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
44
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
55

6-
from decouple import config
7-
86
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
97

108
# Quick-start development settings - unsuitable for production

code_share/requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ flake8==3.4.1
77
gunicorn==19.7.1
88
mccabe==0.6.1
99
packaging==16.8
10-
pkg-resources==0.0.0
1110
psycopg2==2.7.1
1211
py==1.4.34
1312
pycodestyle==2.3.1

0 commit comments

Comments
 (0)