| # Copyright 2014 the Melange authors. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| """Seeder functions for education model.""" |
| |
| import datetime |
| |
| from melange.models import education as education_model |
| |
| |
| _TEST_SCHOOL_COUNTRY = 'United States' |
| _TEST_SCHOOL_ID = 'Melange University' |
| _TEST_EXPECTED_GRADUATION = datetime.date.today().year + 1 |
| |
| def seedEducation(**kwargs): |
| """Seeds a new education entity. |
| |
| Returns: |
| A newly seeder Education entity. |
| """ |
| properties = { |
| 'expected_graduation': _TEST_EXPECTED_GRADUATION, |
| 'school_country': _TEST_SCHOOL_COUNTRY, |
| 'school_id': _TEST_SCHOOL_ID, |
| } |
| properties.update(**kwargs) |
| return education_model.Education(**properties) |