@ -8,7 +8,7 @@ You just landed a new job, congrats! Your new task is to build two functions to
The new registration information comes as string formatted as JSON. You need to create a file `object_to_json.py` that will have the following functions inside:
The new registration information comes as string formatted as JSON. You need to create a file `object_to_json.py` that will have the following functions inside:
1. `create_new_user` that will receive a `dict` and will return a new object of the class `User` provided below. To be valid, the input `dict` must have a `username` key and a `email` key to be valid. The new `User` will have the same `username` and `email` of the input `dict`. If the input `dict` is invalid, the default user will be returned.
1. `create_new_user` that will receive a `dict` and will return a new object of the class `User` provided below. To be valid, the input `dict` must have a `username` key and a `email` key . The new `User` will have the same `username` and `email` of the input `dict`. If the input `dict` is invalid, the default user will be returned.
```python
```python
class User:
class User:
@ -23,8 +23,7 @@ class User:
Here is a possible `test.py` to test your functions:
Here is a possible `test.py` to test your functions:
```python
```python
import create_new_user
from object_to_json import create_new_user, user_to_json