[WIP] Added test case for Chat sessstion View, Contest Form#182
Conversation
| # self.assertTrue(form.is_valid()) | ||
|
|
||
| # def test_ContestForm_invalid(self): | ||
| # form = Contest(data={'name': '112', 'link': 'google.com/', 'description': 'This is a sample description', 'start_date': '9999-99-99', 'end_date': 'csdd-dd-dd', 'approved': 'True'}) |
There was a problem hiding this comment.
line too long (190 > 79 characters)
| # class ContestFormTest(TestCase): | ||
|
|
||
| # def test_ContestForm_valid(self): | ||
| # form = Contest(data = {'name': 'oshc', 'link': 'http://google.com/', 'description': 'This is a sample description', 'start_date': '2014-04-03', 'end_date': '2014-04-04', 'approved': 'True'}) |
There was a problem hiding this comment.
line too long (200 > 79 characters)
| class ContestCreateValidation(TestCase): | ||
| def test_contest_create(self): | ||
| c = Client() | ||
| response = c.post('/contest_new/', {'name': 'oshc', 'link': 'http://google.com/', 'description': 'This is a sample description', 'start_date': '2014-04-03', 'end_date': '2014-04-04', 'approved': 'True'}) |
There was a problem hiding this comment.
line too long (211 > 79 characters)
| class ContestCreateTestCase(TestCase): | ||
| def setUp(self): | ||
| Contest.objects.create(name="oshc", link="http://google.com/", description="This is a sample description", | ||
| start_date="2014-04-03", end_date="2014-04-04", approved=True) |
There was a problem hiding this comment.
line too long (93 > 79 characters)
|
|
||
| class ContestCreateTestCase(TestCase): | ||
| def setUp(self): | ||
| Contest.objects.create(name="oshc", link="http://google.com/", description="This is a sample description", |
There was a problem hiding this comment.
line too long (114 > 79 characters)
|
|
||
| # def test_start_date(self): | ||
| # timestamp =datetime.date.today() | ||
| # ContestStartDate = chatSession.objects.get(start_date=datetime.datetime.fromtimestamp(timestamp, timezone.utc)) |
There was a problem hiding this comment.
line too long (121 > 79 characters)
| def setUp(self): | ||
| timestamp = datetime.date.today() | ||
| chatSession.objects.create(title="oshc-session", profile_name="test_name", profile_url="http://google.com/", description="This is a sample description", | ||
| start_date=datetime.date.today(), end_date=datetime.date.today() + datetime.timedelta(days=1), register_url="http://google.com/") |
There was a problem hiding this comment.
line too long (164 > 79 characters)
| class ChatSessionCreateTestCase(TestCase): | ||
| def setUp(self): | ||
| timestamp = datetime.date.today() | ||
| chatSession.objects.create(title="oshc-session", profile_name="test_name", profile_url="http://google.com/", description="This is a sample description", |
There was a problem hiding this comment.
line too long (160 > 79 characters)
|
|
||
| class ChatSessionCreateTestCase(TestCase): | ||
| def setUp(self): | ||
| timestamp = datetime.date.today() |
There was a problem hiding this comment.
local variable 'timestamp' is assigned to but never used
| from django.urls import reverse | ||
| from main.models import Contest, chatSession | ||
| import datetime | ||
| from django.utils import timezone |
There was a problem hiding this comment.
'django.utils.timezone' imported but unused
383291d to
b181723
Compare
There was a problem hiding this comment.
Great!
- README update to run test
I cleaned up few things on this. When I say python3 oshc/manage.py test, it doesn't run the test. If I say python3 manage.py test after cd into oshc, it works! also if I say python3 oshc/manage.py test <app_name> it works. 🤔 Did you try this out, do you have a good read for this?
cc @jarifibrahim.
|
@tapasweni-pathak This PR still has issues so please leave it for a moment |
|
What issues? 🤔 I am in the process of fixing this coverage part and not specifying all apps. |
|
@tapasweni-pathak issue with |
| self.start_date = timezone.make_aware(datetime.datetime(2017, 11, 6, 12, 10, 5)) | ||
| self.end_date = timezone.make_aware(datetime.datetime(2017, 12, 15, 22, 45, 50)) | ||
| chatSession.objects.create(title="oshc-session", profile_name="test_name", profile_url="http://google.com/", description="This is a sample description", | ||
| start_date=self.start_date, end_date=self.end_date, register_url="http://google.com/") |
There was a problem hiding this comment.
line too long (121 > 79 characters)
| def setUp(self): | ||
| self.start_date = timezone.make_aware(datetime.datetime(2017, 11, 6, 12, 10, 5)) | ||
| self.end_date = timezone.make_aware(datetime.datetime(2017, 12, 15, 22, 45, 50)) | ||
| chatSession.objects.create(title="oshc-session", profile_name="test_name", profile_url="http://google.com/", description="This is a sample description", |
There was a problem hiding this comment.
line too long (160 > 79 characters)
| class ChatSessionCreateTestCase(TestCase): | ||
| def setUp(self): | ||
| self.start_date = timezone.make_aware(datetime.datetime(2017, 11, 6, 12, 10, 5)) | ||
| self.end_date = timezone.make_aware(datetime.datetime(2017, 12, 15, 22, 45, 50)) |
|
|
||
| class ChatSessionCreateTestCase(TestCase): | ||
| def setUp(self): | ||
| self.start_date = timezone.make_aware(datetime.datetime(2017, 11, 6, 12, 10, 5)) |
Checklist
developbranch.Which issue does this PR fix?: fixes #179