from sigma.core import Field, Model, asdict

import pytest


class User(Model):
    name = Field()
    password = Field()


def test_asdict():
    user = User(name="foo", password="<PASSWORD>")
    assert asdict(user) == {"name": "foo", "password": "<PASSWORD>"}
    user2 = User(name="foo")
    assert asdict(user2) == {"name": "foo", "password": None}

from sigma.core import Field, Model, asdict

import pytest


class User(Model):
    name = Field()
    password = Field()


def test_asdict():
    user = User(name="foo", password="<PASSWORD>")
    assert asdict(user) == {"name": "foo", "password": "<PASSWORD>"}
    user2 = User(name="foo")
    assert asdict(user2) == {"name": "foo", "password": None}
