<commit_before># -*- coding: utf-8 -*-

import mock
from nose.tools import *  # noqa (PEP8 asserts)

import hmac
import hashlib
from StringIO import StringIO

import furl
from modularodm import Q
from modularodm.exceptions import ValidationError

from framework.auth import get_or_create_user
from framework.auth.core import Auth
from framework.transactions import commands

from website import settings
from website.models import User, Node
from website.conferences import views
from website.conferences.model import Conference
from website.conferences import utils, message
from website.util import api_url_for, web_url_for

from tests.base import OsfTestCase, fake
from tests.factories import ModularOdmFactory, FakerAttribute, ProjectFactory, UserFactory
from factory import Sequence, post_generation


def assert_absolute(url):
    parsed_domain = furl.furl(settings.DOMAIN)
    parsed_url = furl.furl(url)
    assert_equal(parsed_domain.host, parsed_url.host)


def assert_equal_urls(first, second):
    parsed_first = furl.furl(first)
    parsed_first.port = None
    parsed_second = furl.furl(second)
    parsed_second.port = None
    assert_equal(parsed_first, parsed_second)


class ConferenceFactory(ModularOdmFactory):
    class Meta:
        model = Conference

    endpoint = Sequence(lambda n: 'conference{0}'.format(n))
    name = FakerAttribute('catch_phrase')
    active = True

    @post_generation
    def admins(self, create, extracted, **kwargs):
        self.admins = extracted or [UserFactory()]


def create_fake_conference_nodes(n, endpoint):
    nodes = []
    for i in range(n):
        node = ProjectFactory(is_public=True)
        node.add_tag(endpoint, Auth(node.creator))
        node.save()
        nodes.append(node)
    return nodes

<commit_msg>Added is_meeting to conference factory, fixes failing tests<commit_after># -*- coding: utf-8 -*-

import mock
from nose.tools import *  # noqa (PEP8 asserts)

import hmac
import hashlib
from StringIO import StringIO

import furl
from modularodm import Q
from modularodm.exceptions import ValidationError

from framework.auth import get_or_create_user
from framework.auth.core import Auth
from framework.transactions import commands

from website import settings
from website.models import User, Node
from website.conferences import views
from website.conferences.model import Conference
from website.conferences import utils, message
from website.util import api_url_for, web_url_for

from tests.base import OsfTestCase, fake
from tests.factories import ModularOdmFactory, FakerAttribute, ProjectFactory, UserFactory
from factory import Sequence, post_generation


def assert_absolute(url):
    parsed_domain = furl.furl(settings.DOMAIN)
    parsed_url = furl.furl(url)
    assert_equal(parsed_domain.host, parsed_url.host)


def assert_equal_urls(first, second):
    parsed_first = furl.furl(first)
    parsed_first.port = None
    parsed_second = furl.furl(second)
    parsed_second.port = None
    assert_equal(parsed_first, parsed_second)


class ConferenceFactory(ModularOdmFactory):
    class Meta:
        model = Conference

    endpoint = Sequence(lambda n: 'conference{0}'.format(n))
    name = FakerAttribute('catch_phrase')
    active = True
    is_meeting = True

    @post_generation
    def admins(self, create, extracted, **kwargs):
        self.admins = extracted or [UserFactory()]


def create_fake_conference_nodes(n, endpoint):
    nodes = []
    for i in range(n):
        node = ProjectFactory(is_public=True)
        node.add_tag(endpoint, Auth(node.creator))
        node.save()
        nodes.append(node)
    return nodes


{'fraction_non_alphanumeric': 0.0765840220385675, 'fraction_numerical': 0.001652892561983471, 'mean_word_length': 4.347569955817378, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4594306', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1068, 'n_words': 301}