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

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

src/p/o/portfoliyo-HEAD/portfoliyo/tests/notifications/render/test_base.py   portfoliyo(Download)
                rel = rels[(student, author)]
            post = factories.PostFactory.create(
                author=author,
                student=student,
                relationship=rel,
                    'village', kwargs={'student_id': student.id})
                factories.PostFactory.create(
                    author=teacher,
                    student=student,
                    from_bulk=bulk_post,

src/p/o/portfoliyo-HEAD/portfoliyo/tests/test_serializers.py   portfoliyo(Download)
        from_profile__name='The Teacher', description='desc')
    post = factories.PostFactory.create(
        author=rel.elder,
        student=rel.student,
        relationship=rel,
def test_post2dict_timestamp_display(db, mock_now):
    """Natural date for a nearby date."""
    post = factories.PostFactory.create(
        timestamp=datetime.datetime(2013, 2, 11, 8, 32, tzinfo=timezone.utc))
 
def test_post2dict_no_author(db):
    """Special handling for author-less (automated) posts."""
    student = factories.ProfileFactory.create()
    post = factories.PostFactory.create(author=None, student=student)
 
        )
    post = factories.PostFactory.create(
        author=rel.elder,
        student=rel.student,
        )

src/p/o/portfoliyo-HEAD/portfoliyo/tests/view/village/test_views.py   portfoliyo(Download)
    def test_student(self, db, redis):
        """Given student, returns posts in student village."""
        profile = factories.ProfileFactory.create()
        post1 = factories.PostFactory.create()
        post2 = factories.PostFactory.create(student=post1.student)
    def test_ordering(self, db, redis):
        """Posts are ordered by timestamp."""
        profile = factories.ProfileFactory.create()
        second_post = factories.PostFactory.create(
            timestamp=datetime.datetime(2013, 1, 25, 12))
        first_post = factories.PostFactory.create(
            student=second_post.student,
    def test_unread(self, db, redis):
        """Marks posts in student village correctly as read/unread."""
        profile = factories.ProfileFactory.create()
        read_post = factories.PostFactory.create()
        unread_post = factories.PostFactory.create(

src/p/o/portfoliyo-HEAD/portfoliyo/tests/model/village/test_admin.py   portfoliyo(Download)
def test_post_changelist(client):
    factories.PostFactory.create()
 
    url = reverse('admin:village_post_changelist')
 
def test_filter_by_author(client):
    factories.PostFactory.create(original_text='foobar')
    p = factories.PostFactory.create(original_text='other')
 
    url = reverse('admin:village_post_changelist') + '?author=%s' % p.author_id
def test_filter_by_no_author(client):
    factories.PostFactory.create(original_text='foobar')
    factories.PostFactory.create(original_text='other', author=None)
 
    url = reverse('admin:village_post_changelist') + '?author=0'

src/p/o/portfoliyo-HEAD/portfoliyo/tests/api/test_resources.py   portfoliyo(Download)
    def test_unread_count(self, no_csrf_client):
        """Each profile has an unread_count in the API response."""
        rel = factories.RelationshipFactory.create(
            from_profile__school_staff=True)
        post = factories.PostFactory.create(student=rel.student)
        rel2 = factories.RelationshipFactory.create(
            from_profile=rel.elder)
        post = factories.PostFactory.create(student=rel.student)
        post2 = factories.PostFactory.create(student=rel2.student)
        unread.mark_unread(post, rel.elder)
    def test_unread_count(self, no_csrf_client):
        """Each group has an unread_count in the API response."""
        rel = factories.RelationshipFactory.create()
        post = factories.PostFactory.create(student=rel.student)
        other_rel = factories.RelationshipFactory.create(from_profile=rel.elder)
        other_post = factories.PostFactory.create(student=other_rel.student)

src/p/o/portfoliyo-HEAD/portfoliyo/tests/model/village/test_models.py   portfoliyo(Download)
def test_get_absolute_url(db):
    """A Post's absolute-url is its village URL. (For admin view-on-site.)"""
    post = factories.PostFactory.create()
 
    assert post.get_absolute_url() == reverse(
    def test_relationship_deleted(self, db):
        """Deleting a relationship does not delete posts in that village."""
        rel = factories.RelationshipFactory.create()
        post = factories.PostFactory.create(
            student=rel.student, relationship=rel)

src/p/o/portfoliyo-HEAD/portfoliyo/tests/pusher/test_events.py   portfoliyo(Download)
        from_profile__school_staff=True, to_profile=author_rel.student)
    p = factories.PostFactory.create(
        author=author_rel.elder, student=author_rel.student)
 
    with mock.patch('portfoliyo.pusher.events.get_pusher') as mock_get_pusher:

src/p/o/portfoliyo-HEAD/portfoliyo/tests/model/village/test_unread.py   portfoliyo(Download)
def test_read(db, redis):
    """By default, a post is read."""
    post = factories.PostFactory.create()
    profile = factories.ProfileFactory.create()
 
def test_unread(db, redis):
    """After marking a post unread, it shows up as unread."""
    post = factories.PostFactory.create()
    profile = factories.ProfileFactory.create()
 
def test_all_unread(db, redis):
    """After marking a post unread, it shows up in all_unread set."""
    post = factories.PostFactory.create()
    profile = factories.ProfileFactory.create()
 
def test_mark_read(db, redis):
    """Can mark a post as read."""
    post = factories.PostFactory.create()
    profile = factories.ProfileFactory.create()
    unread.mark_unread(post, profile)
def test_mark_village_read(db, redis):
    """Marks posts only in given village read."""
    post1 = factories.PostFactory.create()
    post2 = factories.PostFactory.create(student=post1.student)
    other_village_post = factories.PostFactory.create()