Example #1
0
class HelpRequest(models.Model):
    class_name = models.CharField(max_length=20)
    topic = models.CharField(max_length=200)
    location = models.CharField(max_length=60,
                                choices=LOCATIONS,
                                default='green')
    time = models.IntegerField(choices=TIMES, default=5)
    day = models.DateField(max_length=100, default=timezone.now)
    # need to attach a user here for contact information
    name = models.CharField(max_length=60, default='Not Real Name')
    phone = models.CharField(max_length=60, default='XXXXXXXXXX')
    user = UserProfile()

    def __str__(self):
        return self.topic
Example #2
0
 def test_isChangedName(self):
     current_user = UserProfile(name="Bobby", phone="123-434-3567")
     current_user.name = "Bob"
     self.assertEqual(current_user.name, "Bob")
Example #3
0
 def test_isPhone(self):
     current_user = UserProfile(name="Bob", phone="434-123-4567")
     self.assertEqual(current_user.phone, "434-123-4567")
Example #4
0
 def test_isDefault(self):
     current_user = UserProfile()
     self.assertEqual(current_user.name, "")
Example #5
0
 def test_isChangedLocation(self):
     current_tutor = UserProfile(name="Bobby",
                                 phone="123-434-3567",
                                 tutor_location="Clem Library")
     current_tutor.tutor_location = "Clark Library"
     self.assertEqual(current_tutor.tutor_location, "Clark Library")
Example #6
0
 def test_isDefaultLocation(self):
     current_tutor = UserProfile(name="Bob", phone="434-123-4567")
     self.assertEqual(current_tutor.tutor_location, "Anywhere")
Example #7
0
 def test_isDefaultStatus(self):
     current_tutor = UserProfile(name="Bob", phone="434-123-4567")
     self.assertEqual(current_tutor.status, False)