Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(126)  |  Call(126)  |  Derive(0)  |  Import(0)

src/p/o/portfoliyo-HEAD/portfoliyo/tests/sms/test_hook.py   portfoliyo(Download)
def test_group_code_signup(db):
    """Parent can create account by texting group code."""
    phone = '+13216430987'
    group = factories.GroupFactory.create(
        owner__school_staff=True, owner__name="Teacher Jane", code="ABCDEFG")
def test_group_code_signup_student_name(db):
    """Parent can continue group code signup by providing student name."""
    phone = '+13216430987'
    group = factories.GroupFactory.create(
        owner__school_staff=True, owner__name="Teacher Jane", code="ABCDEFG")
        from_profile=signup.family, to_profile=signup.student)
    group = factories.GroupFactory.create(
        code='ABCDEF', owner__name='Ms. Doe')
 
    with mock.patch('portfoliyo.sms.hook.track_signup') as mock_track:
        )
    group = factories.GroupFactory.create(
        code='ABCDEF', owner__name='Ms. Doe')
 
    reply = hook.receive_sms(phone, settings.DEFAULT_NUMBER, 'ABCDEF')
    def test_group_code(self, db):
        """Gets teacher and group if text starts with group code."""
        g = factories.GroupFactory.create(
            code='ABCDEFG', owner__code='ABCDEF')
 

src/p/o/portfoliyo-HEAD/portfoliyo/tests/view/village/test_views.py   portfoliyo(Download)
    def test_maintain_group_context(self, client):
        """Can take ?group=id to maintain group nav context."""
        rel = factories.RelationshipFactory.create(
            from_profile__school_staff=True)
        group = factories.GroupFactory.create(owner=rel.elder)
    def test_group_context_student_must_be_in_group(self, client):
        """?group=id not effective unless student is in group."""
        rel = factories.RelationshipFactory.create(
            from_profile__school_staff=True)
        group = factories.GroupFactory.create(owner=rel.elder)
    def test_group_context_must_own_group(self, client):
        """?group=id not effective unless active user owns group."""
        rel = factories.RelationshipFactory.create(
            from_profile__school_staff=True)
        group = factories.GroupFactory.create()
    def test_group_dashboard(self, client):
        """Group dashboard contains group name, student/teacher/family count."""
        group = factories.GroupFactory.create(
            owner__school_staff=True, name="Some Group")
        rel = factories.RelationshipFactory(
    def test_contains_group_pdf_link(self, client):
        """Group add student page has link to parent instructions PDF."""
        g = factories.GroupFactory.create(
            code='ABCDEF', owner__school_staff=True)
        pdf_link = reverse(

src/p/o/portfoliyo-HEAD/portfoliyo/tests/api/test_resources.py   portfoliyo(Download)
    def test_filter_by_elder_in_group(self, no_csrf_client):
        """Can filter profiles by group elder memberships."""
        s1 = factories.ProfileFactory.create()
        s2 = factories.ProfileFactory.create(school=s1.school)
        group = factories.GroupFactory.create(owner__school=s1.school)
    def test_filter_by_student_in_group(self, no_csrf_client):
        """Can filter profiles by group student memberships."""
        s1 = factories.ProfileFactory.create()
        s2 = factories.ProfileFactory.create(school=s1.school)
        group = factories.GroupFactory.create(owner__school=s1.school)
        other_rel = factories.RelationshipFactory.create(from_profile=rel.elder)
        other_post = factories.PostFactory.create(student=other_rel.student)
        group = factories.GroupFactory.create(owner=rel.elder)
        group.students.add(rel.student)
        group.students.add(other_rel.student)
        other_rel = factories.RelationshipFactory.create(from_profile=rel.elder)
        other_post = factories.PostFactory.create(student=other_rel.student)
        group = factories.GroupFactory.create(owner=rel.elder)
        group.students.add(rel.student)
        group.students.add(other_rel.student)
    def test_only_see_my_groups(self, no_csrf_client):
        """User can only see their own groups in API, not even same-school."""
        g1 = factories.GroupFactory.create()
        factories.GroupFactory.create(owner__school=g1.owner.school)
 

src/p/o/portfoliyo-HEAD/portfoliyo/tests/model/users/test_models.py   portfoliyo(Download)
        e = factories.ProfileFactory.create()
        s = factories.ProfileFactory.create()
        g = factories.GroupFactory.create()
        g.students.add(s, rel.student)
        g.elders.add(e)
    def test_group_creates_relationships(self, db):
        """A group creates relationships between its students and elders."""
        s = factories.ProfileFactory.create()
        e = factories.ProfileFactory.create()
        g = factories.GroupFactory.create()
    def test_no_create_dupe_relationship(self, db):
        """If a relationship already exists, don't re-create it."""
        rel = factories.RelationshipFactory.create()
        g = factories.GroupFactory.create()
        g.students.add(rel.student)
        rel = factories.RelationshipFactory.create()
        s = factories.ProfileFactory.create()
        g = factories.GroupFactory.create()
        g.students.add(s)
        g.elders.add(rel.elder)
        rel = factories.RelationshipFactory.create()
        s = factories.ProfileFactory.create()
        g = factories.GroupFactory.create()
        g.students.add(s)
        g.elders.add(rel.elder)

src/p/o/portfoliyo-HEAD/portfoliyo/tests/view/village/test_forms.py   portfoliyo(Download)
    def test_invite_teacher_with_students_and_groups(self, db):
        """Can associate newly-invited teacher with students and groups."""
        rel = factories.RelationshipFactory.create()
        rel2 = factories.RelationshipFactory.create(from_profile=rel.elder)
        group = factories.GroupFactory.create(owner=rel.elder)
            from_profile__user__email='foo@example.com',
            )
        group = factories.GroupFactory.create(owner=rel.elder)
        group.students.add(rel.student)
        group.elders.add(other_rel.elder)
    def test_invite_teacher_never_removes_from_another_teachers_group(self, db):
        rel = factories.RelationshipFactory.create()
        elder = factories.ProfileFactory.create(user__email='foo@example.com')
        group = factories.GroupFactory.create()
        group.elders.add(elder)
    def test_invite_teacher_never_removes_from_my_group(self, db):
        """Inviting a teacher should never remove them from groups."""
        rel = factories.RelationshipFactory.create()
        elder = factories.ProfileFactory.create(user__email='foo@example.com')
        group = factories.GroupFactory.create(owner=rel.elder)
    def test_context_group_pre_checked(self, db):
        """Group teacher is invited to is initially checked."""
        group = factories.GroupFactory.create()
 
        form = forms.InviteTeacherForm(group=group)

src/p/o/portfoliyo-HEAD/portfoliyo/tests/model/village/test_models.py   portfoliyo(Download)
        rel3 = factories.RelationshipFactory.create(
            from_profile__user__email=None, to_profile=rel.student)
        group = factories.GroupFactory.create(owner=rel.elder)
        group.students.add(rel.student)
 
            from_profile__name="Jim Smith",
            )
        group = factories.GroupFactory.create()
        group.students.add(rel1.student)
 
            from_profile__name="Jim Smith",
            )
        group = factories.GroupFactory.create()
        group.students.add(rel1.student)
 
    def test_records_notifications(self, db):
        """Records notification for users in group."""
        group = factories.GroupFactory.create()
        rel = factories.RelationshipFactory.create(
            from_profile=group.owner)

src/p/o/portfoliyo-HEAD/portfoliyo/tests/notifications/render/test_base.py   portfoliyo(Download)
 
            if group_name is not None:
                ts.group = factories.GroupFactory.create(name=group_name)
                context['%sUrl' % group_name] = reverse(
                    'group', kwargs={'group_id': ts.group_id})
                        name=st_name)
                all_students.append(name_map[st_name])
            group = factories.GroupFactory.create(owner=teacher)
            group.students.add(*all_students)
            html_text = "html: %s" % msg

src/p/o/portfoliyo-HEAD/portfoliyo/tests/pusher/test_events.py   portfoliyo(Download)
def test_group_event(db):
    """Pusher event for adding/editing/removing a group."""
    group = factories.GroupFactory.create()
    with mock.patch('portfoliyo.pusher.events.get_pusher') as mock_get_pusher:
        channel = mock.Mock()

src/p/o/portfoliyo-HEAD/portfoliyo/tests/model/village/test_unread.py   portfoliyo(Download)
def test_group_unread_count(db, redis):
    post1 = factories.PostFactory.create()
    factories.PostFactory.create(student=post1.student)
    post2 = factories.PostFactory.create()
    group = factories.GroupFactory.create()
    post5 = factories.PostFactory.create()
    factories.PostFactory.create(student=post5.student)
    groupa = factories.GroupFactory.create()
    groupa.students.add(post1.student, post2.student)
    groupb = factories.GroupFactory.create()