Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: dirkcuys/lernanta
...
head fork: dirkcuys/lernanta
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
2  lernanta/apps/projects/tests.py
View
@@ -54,7 +54,7 @@ def test_course_creation(self):
password=self.test_password)
response = self.client.post('/%s/groups/create/' % (self.locale,),
data)
- self.assertRedirects(response,
+ self.assertRedirects(response,
'/%s/groups/%s/' % (self.locale, 'test-new-course'),
target_status_code=200)
5 lernanta/apps/schools/models.py
View
@@ -133,9 +133,10 @@ def get_image_url(self):
return image_path
def _distinct_participants(self):
- return UserProfile.objects.filter(participations__project__projectsets=self,
- deleted=False,
+ return UserProfile.objects.filter(participations__project__projectsets=self,
+ deleted=False,
participations__left_on__isnull=True).distinct()
+
def total_participants(self):
return self._distinct_participants().filter(
participations__adopter = False,
40 lernanta/apps/schools/tests.py
View
@@ -0,0 +1,40 @@
+from django.test import Client
+from django.contrib.auth.models import User
+
+from users.models import create_profile
+from schools.models import School
+
+from test_utils import TestCase
+
+
+class SchoolTests(TestCase):
+
+ test_username = 'testuser'
+ test_email = 'test@mozillafoundation.org'
+ test_password = 'testpass'
+
+ def setUp(self):
+ self.client = Client()
+ self.locale = 'en'
+ django_user = User(
+ username=self.test_username,
+ email=self.test_email,
+ )
+ self.user = create_profile(django_user)
+ self.user.set_password(self.test_password)
+ self.user.save()
+
+ def test_create_school(self):
+ school = School(
+ name = "The great School of Test",
+ short_name = "test school",
+ description = "<p>Some rich text description?</p>"
+ )
+ school.save()
+ self.assertEqual('the-great-school-of-test', school.slug)
+
+ self.assertEqual(
+ School.objects.get(slug='the-great-school-of-test'),
+ school
+ )
+

No commit comments for this range

Something went wrong with that request. Please try again.