Exemple #1
0
def test_user_nome():

    user = User("Vladimir Lenin", "*****@*****.**",
                "lenin#0803")
    assert user.name == "VLADIMIR LENIN"
    assert user.email == "*****@*****.**"
    assert user.discord_id == "lenin#0803"
Exemple #2
0
def add_org():
    data = request.get_json()
    ownerData = data['owner']
    owner = User(ownerData['name'], ownerData['email'],
                 ownerData['discord_id'])
    return str(
        organization_controller.add_organization(data['name'], data['desc'],
                                                 owner, data['category']))
Exemple #3
0
def test_user_email_wrong_format():
    try:
        user = User("Vladimir Lenin", "*****@*****.**", "lenin#0803")
        fail()
    except AttributeError:
        pass

    try:
        user = User("Vladimir Lenin", "lenin.vladimirccc.ufcg.edu.br",
                    "lenin#0803")
        fail()
    except AttributeError:
        pass

    try:
        user = User("Vladimir Lenin", "*****@*****.**",
                    "lenin#0803")
        fail()
    except AttributeError:
        pass
Exemple #4
0
def test_user_discord_wrong_format():

    try:
        user = User("Vladimir Lenin", "*****@*****.**",
                    "lenin#803")
        fail()
    except AttributeError:
        pass

    try:
        user = User("Vladimir Lenin", "*****@*****.**",
                    "lenin0803")
        fail()
    except AttributeError:
        pass

    try:
        user = User("Vladimir Lenin", "*****@*****.**",
                    "lenin#lenin")
        fail()
    except AttributeError:
        pass
Exemple #5
0
 def __init__(self, name, email, discord_id, period, minority_group=''):
     User.__init__(self, name, email, discord_id)
     self.period = period
     self.minority_group = minority_group
Exemple #6
0
def test_user_name_not_string():
    try:
        user = User(1917, "*****@*****.**", "lenin#0803")
        fail()
    except AttributeError:
        pass
Exemple #7
0
def test_user_discord_empty():
    try:
        user = User("Vladimir Lenin", "*****@*****.**", "")
        fail()
    except AttributeError:
        pass
Exemple #8
0
def test_user_email_empty():
    try:
        user = User("Vladimir Lenin", "", "lenin#0803")
        fail()
    except AttributeError:
        pass
Exemple #9
0
def test_user_name_empty():
    try:
        user = User("", "*****@*****.**", "lenin#0803")
        fail()
    except AttributeError:
        pass
Exemple #10
0
def test_user_null_fields():
    try:
        user = User(None, None, None)
        fail()
    except AttributeError:
        pass
Exemple #11
0
 def __init__(self, name, email, discord_id, state='', organization=''):
     User.__init__(self, name, email, discord_id)
     self.state = state