Skip to content

Commit

Permalink
add relation between response and project
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsmedina committed Jul 30, 2011
1 parent 8df2627 commit 73fdb33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions startdust_website/responses/models.py
@@ -1,9 +1,11 @@
from django.db import models from django.db import models
from datetime import datetime from datetime import datetime
from projects.models import Project




class Response(models.Model): class Response(models.Model):


time = models.IntegerField() time = models.IntegerField()
url = models.URLField(verify_exists=False) url = models.URLField(verify_exists=False)
date = models.DateTimeField(default=datetime.now, editable=False) date = models.DateTimeField(default=datetime.now, editable=False)
project = models.ForeignKey(Project, null=True, editable=False) #will be change this
6 changes: 6 additions & 0 deletions startdust_website/responses/tests.py
Expand Up @@ -22,6 +22,12 @@ def test_response_model_should_have_date_attribute(self):
''' '''
self.assertFieldIn('date', Response._meta.fields) self.assertFieldIn('date', Response._meta.fields)


def test_response_should_be_related_with_project(self):
'''
Response should be related with Project
'''
self.assertFieldIn('project', Response._meta.fields)

def assertFieldIn(self, expected_field, field_list): def assertFieldIn(self, expected_field, field_list):
''' '''
assert if field in a field list assert if field in a field list
Expand Down

0 comments on commit 73fdb33

Please sign in to comment.