Permalink
Browse files

add relation between response and project

  • Loading branch information...
1 parent 8df2627 commit 73fdb33733eb8e4d67745ed12133ae09f5030be4 @andrewsmedina committed Jul 30, 2011
Showing with 8 additions and 0 deletions.
  1. +2 −0 startdust_website/responses/models.py
  2. +6 −0 startdust_website/responses/tests.py
@@ -1,9 +1,11 @@
from django.db import models
from datetime import datetime
+from projects.models import Project
class Response(models.Model):
time = models.IntegerField()
url = models.URLField(verify_exists=False)
date = models.DateTimeField(default=datetime.now, editable=False)
+ project = models.ForeignKey(Project, null=True, editable=False) #will be change this
@@ -22,6 +22,12 @@ def test_response_model_should_have_date_attribute(self):
'''
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):
'''
assert if field in a field list

0 comments on commit 73fdb33

Please sign in to comment.